home *** CD-ROM | disk | FTP | other *** search
/ Clickx 115 / Clickx 115.iso / software / tools / windows / tails-i386-0.16.iso / live / filesystem.squashfs / usr / share / pyshared / libxml2.py < prev    next >
Encoding:
Python Source  |  2012-11-29  |  333.3 KB  |  9,204 lines

  1. import libxml2mod
  2. import types
  3. import sys
  4.  
  5. # The root of all libxml2 errors.
  6. class libxmlError(Exception): pass
  7.  
  8. #
  9. # id() is sometimes negative ...
  10. #
  11. def pos_id(o):
  12.     i = id(o)
  13.     if (i < 0):
  14.         return (sys.maxint - i)
  15.     return i
  16.  
  17. #
  18. # Errors raised by the wrappers when some tree handling failed.
  19. #
  20. class treeError(libxmlError):
  21.     def __init__(self, msg):
  22.         self.msg = msg
  23.     def __str__(self):
  24.         return self.msg
  25.  
  26. class parserError(libxmlError):
  27.     def __init__(self, msg):
  28.         self.msg = msg
  29.     def __str__(self):
  30.         return self.msg
  31.  
  32. class uriError(libxmlError):
  33.     def __init__(self, msg):
  34.         self.msg = msg
  35.     def __str__(self):
  36.         return self.msg
  37.  
  38. class xpathError(libxmlError):
  39.     def __init__(self, msg):
  40.         self.msg = msg
  41.     def __str__(self):
  42.         return self.msg
  43.  
  44. class ioWrapper:
  45.     def __init__(self, _obj):
  46.         self.__io = _obj
  47.         self._o = None
  48.  
  49.     def io_close(self):
  50.         if self.__io == None:
  51.             return(-1)
  52.         self.__io.close()
  53.         self.__io = None
  54.         return(0)
  55.  
  56.     def io_flush(self):
  57.         if self.__io == None:
  58.             return(-1)
  59.         self.__io.flush()
  60.         return(0)
  61.  
  62.     def io_read(self, len = -1):
  63.         if self.__io == None:
  64.             return(-1)
  65.         if len < 0:
  66.             return(self.__io.read())
  67.         return(self.__io.read(len))
  68.  
  69.     def io_write(self, str, len = -1):
  70.         if self.__io == None:
  71.             return(-1)
  72.         if len < 0:
  73.             return(self.__io.write(str))
  74.         return(self.__io.write(str, len))
  75.  
  76. class ioReadWrapper(ioWrapper):
  77.     def __init__(self, _obj, enc = ""):
  78.         ioWrapper.__init__(self, _obj)
  79.         self._o = libxml2mod.xmlCreateInputBuffer(self, enc)
  80.  
  81.     def __del__(self):
  82.         print "__del__"
  83.         self.io_close()
  84.         if self._o != None:
  85.             libxml2mod.xmlFreeParserInputBuffer(self._o)
  86.         self._o = None
  87.  
  88.     def close(self):
  89.         self.io_close()
  90.         if self._o != None:
  91.             libxml2mod.xmlFreeParserInputBuffer(self._o)
  92.         self._o = None
  93.  
  94. class ioWriteWrapper(ioWrapper):
  95.     def __init__(self, _obj, enc = ""):
  96. #        print "ioWriteWrapper.__init__", _obj
  97.         if type(_obj) == type(''):
  98.             print "write io from a string"
  99.             self.o = None
  100.         elif type(_obj) == types.InstanceType:
  101.             print "write io from instance of %s" % (_obj.__class__)
  102.             ioWrapper.__init__(self, _obj)
  103.             self._o = libxml2mod.xmlCreateOutputBuffer(self, enc)
  104.         else:
  105.             file = libxml2mod.outputBufferGetPythonFile(_obj)
  106.             if file != None:
  107.                 ioWrapper.__init__(self, file)
  108.             else:
  109.                 ioWrapper.__init__(self, _obj)
  110.             self._o = _obj
  111.  
  112.     def __del__(self):
  113. #        print "__del__"
  114.         self.io_close()
  115.         if self._o != None:
  116.             libxml2mod.xmlOutputBufferClose(self._o)
  117.         self._o = None
  118.  
  119.     def flush(self):
  120.         self.io_flush()
  121.         if self._o != None:
  122.             libxml2mod.xmlOutputBufferClose(self._o)
  123.         self._o = None
  124.  
  125.     def close(self):
  126.         self.io_flush()
  127.         if self._o != None:
  128.             libxml2mod.xmlOutputBufferClose(self._o)
  129.         self._o = None
  130.  
  131. #
  132. # Example of a class to handle SAX events
  133. #
  134. class SAXCallback:
  135.     """Base class for SAX handlers"""
  136.     def startDocument(self):
  137.         """called at the start of the document"""
  138.         pass
  139.  
  140.     def endDocument(self):
  141.         """called at the end of the document"""
  142.         pass
  143.  
  144.     def startElement(self, tag, attrs):
  145.         """called at the start of every element, tag is the name of
  146.            the element, attrs is a dictionary of the element's attributes"""
  147.         pass
  148.  
  149.     def endElement(self, tag):
  150.         """called at the start of every element, tag is the name of
  151.            the element"""
  152.         pass
  153.  
  154.     def characters(self, data):
  155.         """called when character data have been read, data is the string
  156.            containing the data, multiple consecutive characters() callback
  157.            are possible."""
  158.         pass
  159.  
  160.     def cdataBlock(self, data):
  161.         """called when CDATA section have been read, data is the string
  162.            containing the data, multiple consecutive cdataBlock() callback
  163.            are possible."""
  164.         pass
  165.  
  166.     def reference(self, name):
  167.         """called when an entity reference has been found"""
  168.         pass
  169.  
  170.     def ignorableWhitespace(self, data):
  171.         """called when potentially ignorable white spaces have been found"""
  172.         pass
  173.  
  174.     def processingInstruction(self, target, data):
  175.         """called when a PI has been found, target contains the PI name and
  176.            data is the associated data in the PI"""
  177.         pass
  178.  
  179.     def comment(self, content):
  180.         """called when a comment has been found, content contains the comment"""
  181.         pass
  182.  
  183.     def externalSubset(self, name, externalID, systemID):
  184.         """called when a DOCTYPE declaration has been found, name is the
  185.            DTD name and externalID, systemID are the DTD public and system
  186.            identifier for that DTd if available"""
  187.         pass
  188.  
  189.     def internalSubset(self, name, externalID, systemID):
  190.         """called when a DOCTYPE declaration has been found, name is the
  191.            DTD name and externalID, systemID are the DTD public and system
  192.            identifier for that DTD if available"""
  193.         pass
  194.  
  195.     def entityDecl(self, name, type, externalID, systemID, content):
  196.         """called when an ENTITY declaration has been found, name is the
  197.            entity name and externalID, systemID are the entity public and
  198.            system identifier for that entity if available, type indicates
  199.            the entity type, and content reports it's string content"""
  200.         pass
  201.  
  202.     def notationDecl(self, name, externalID, systemID):
  203.         """called when an NOTATION declaration has been found, name is the
  204.            notation name and externalID, systemID are the notation public and
  205.            system identifier for that notation if available"""
  206.         pass
  207.  
  208.     def attributeDecl(self, elem, name, type, defi, defaultValue, nameList):
  209.         """called when an ATTRIBUTE definition has been found"""
  210.         pass
  211.  
  212.     def elementDecl(self, name, type, content):
  213.         """called when an ELEMENT definition has been found"""
  214.         pass
  215.  
  216.     def entityDecl(self, name, publicId, systemID, notationName):
  217.         """called when an unparsed ENTITY declaration has been found,
  218.            name is the entity name and publicId,, systemID are the entity
  219.            public and system identifier for that entity if available,
  220.            and notationName indicate the associated NOTATION"""
  221.         pass
  222.  
  223.     def warning(self, msg):
  224.         #print msg
  225.         pass
  226.  
  227.     def error(self, msg):
  228.         raise parserError(msg)
  229.  
  230.     def fatalError(self, msg):
  231.         raise parserError(msg)
  232.  
  233. #
  234. # This class is the ancestor of all the Node classes. It provides
  235. # the basic functionalities shared by all nodes (and handle
  236. # gracefylly the exception), like name, navigation in the tree,
  237. # doc reference, content access and serializing to a string or URI
  238. #
  239. class xmlCore:
  240.     def __init__(self, _obj=None):
  241.         if _obj != None: 
  242.             self._o = _obj;
  243.             return
  244.         self._o = None
  245.  
  246.     def __eq__(self, other):
  247.         if other == None:
  248.             return False
  249.         ret = libxml2mod.compareNodesEqual(self._o, other._o)
  250.         if ret == None:
  251.             return False
  252.         return ret == True
  253.     def __ne__(self, other):
  254.         if other == None:
  255.             return True
  256.         ret = libxml2mod.compareNodesEqual(self._o, other._o)
  257.         return not ret
  258.     def __hash__(self):
  259.         ret = libxml2mod.nodeHash(self._o)
  260.         return ret
  261.  
  262.     def __str__(self):
  263.         return self.serialize()
  264.     def get_parent(self):
  265.         ret = libxml2mod.parent(self._o)
  266.         if ret == None:
  267.             return None
  268.         return xmlNode(_obj=ret)
  269.     def get_children(self):
  270.         ret = libxml2mod.children(self._o)
  271.         if ret == None:
  272.             return None
  273.         return xmlNode(_obj=ret)
  274.     def get_last(self):
  275.         ret = libxml2mod.last(self._o)
  276.         if ret == None:
  277.             return None
  278.         return xmlNode(_obj=ret)
  279.     def get_next(self):
  280.         ret = libxml2mod.next(self._o)
  281.         if ret == None:
  282.             return None
  283.         return xmlNode(_obj=ret)
  284.     def get_properties(self):
  285.         ret = libxml2mod.properties(self._o)
  286.         if ret == None:
  287.             return None
  288.         return xmlAttr(_obj=ret)
  289.     def get_prev(self):
  290.         ret = libxml2mod.prev(self._o)
  291.         if ret == None:
  292.             return None
  293.         return xmlNode(_obj=ret)
  294.     def get_content(self):
  295.         return libxml2mod.xmlNodeGetContent(self._o)
  296.     getContent = get_content  # why is this duplicate naming needed ?
  297.     def get_name(self):
  298.         return libxml2mod.name(self._o)
  299.     def get_type(self):
  300.         return libxml2mod.type(self._o)
  301.     def get_doc(self):
  302.         ret = libxml2mod.doc(self._o)
  303.         if ret == None:
  304.             if self.type in ["document_xml", "document_html"]:
  305.                 return xmlDoc(_obj=self._o)
  306.             else:
  307.                 return None
  308.         return xmlDoc(_obj=ret)
  309.     #
  310.     # Those are common attributes to nearly all type of nodes
  311.     # defined as python2 properties
  312.     # 
  313.     import sys
  314.     if float(sys.version[0:3]) < 2.2:
  315.         def __getattr__(self, attr):
  316.             if attr == "parent":
  317.                 ret = libxml2mod.parent(self._o)
  318.                 if ret == None:
  319.                     return None
  320.                 return xmlNode(_obj=ret)
  321.             elif attr == "properties":
  322.                 ret = libxml2mod.properties(self._o)
  323.                 if ret == None:
  324.                     return None
  325.                 return xmlAttr(_obj=ret)
  326.             elif attr == "children":
  327.                 ret = libxml2mod.children(self._o)
  328.                 if ret == None:
  329.                     return None
  330.                 return xmlNode(_obj=ret)
  331.             elif attr == "last":
  332.                 ret = libxml2mod.last(self._o)
  333.                 if ret == None:
  334.                     return None
  335.                 return xmlNode(_obj=ret)
  336.             elif attr == "next":
  337.                 ret = libxml2mod.next(self._o)
  338.                 if ret == None:
  339.                     return None
  340.                 return xmlNode(_obj=ret)
  341.             elif attr == "prev":
  342.                 ret = libxml2mod.prev(self._o)
  343.                 if ret == None:
  344.                     return None
  345.                 return xmlNode(_obj=ret)
  346.             elif attr == "content":
  347.                 return libxml2mod.xmlNodeGetContent(self._o)
  348.             elif attr == "name":
  349.                 return libxml2mod.name(self._o)
  350.             elif attr == "type":
  351.                 return libxml2mod.type(self._o)
  352.             elif attr == "doc":
  353.                 ret = libxml2mod.doc(self._o)
  354.                 if ret == None:
  355.                     if self.type == "document_xml" or self.type == "document_html":
  356.                         return xmlDoc(_obj=self._o)
  357.                     else:
  358.                         return None
  359.                 return xmlDoc(_obj=ret)
  360.             raise AttributeError,attr
  361.     else:
  362.         parent = property(get_parent, None, None, "Parent node")
  363.         children = property(get_children, None, None, "First child node")
  364.         last = property(get_last, None, None, "Last sibling node")
  365.         next = property(get_next, None, None, "Next sibling node")
  366.         prev = property(get_prev, None, None, "Previous sibling node")
  367.         properties = property(get_properties, None, None, "List of properies")
  368.         content = property(get_content, None, None, "Content of this node")
  369.         name = property(get_name, None, None, "Node name")
  370.         type = property(get_type, None, None, "Node type")
  371.         doc = property(get_doc, None, None, "The document this node belongs to")
  372.  
  373.     #
  374.     # Serialization routines, the optional arguments have the following
  375.     # meaning:
  376.     #     encoding: string to ask saving in a specific encoding
  377.     #     indent: if 1 the serializer is asked to indent the output
  378.     #
  379.     def serialize(self, encoding = None, format = 0):
  380.         return libxml2mod.serializeNode(self._o, encoding, format)
  381.     def saveTo(self, file, encoding = None, format = 0):
  382.         return libxml2mod.saveNodeTo(self._o, file, encoding, format)
  383.             
  384.     #
  385.     # Canonicalization routines:
  386.     #
  387.     #   nodes: the node set (tuple or list) to be included in the
  388.     #     canonized image or None if all document nodes should be
  389.     #     included.
  390.     #   exclusive: the exclusive flag (0 - non-exclusive
  391.     #     canonicalization; otherwise - exclusive canonicalization)
  392.     #   prefixes: the list of inclusive namespace prefixes (strings),
  393.     #     or None if there is no inclusive namespaces (only for
  394.     #     exclusive canonicalization, ignored otherwise)
  395.     #   with_comments: include comments in the result (!=0) or not
  396.     #     (==0)
  397.     def c14nMemory(self,
  398.                    nodes=None,
  399.                    exclusive=0,
  400.                    prefixes=None,
  401.                    with_comments=0):
  402.         if nodes:
  403.             nodes = map(lambda n: n._o, nodes)
  404.         return libxml2mod.xmlC14NDocDumpMemory(
  405.             self.get_doc()._o,
  406.             nodes,
  407.             exclusive != 0,
  408.             prefixes,
  409.             with_comments != 0)
  410.     def c14nSaveTo(self,
  411.                    file,
  412.                    nodes=None,
  413.                    exclusive=0,
  414.                    prefixes=None,
  415.                    with_comments=0):
  416.         if nodes:
  417.             nodes = map(lambda n: n._o, nodes)
  418.         return libxml2mod.xmlC14NDocSaveTo(
  419.             self.get_doc()._o,
  420.             nodes,
  421.             exclusive != 0,
  422.             prefixes,
  423.             with_comments != 0,
  424.             file)
  425.  
  426.     #
  427.     # Selecting nodes using XPath, a bit slow because the context
  428.     # is allocated/freed every time but convenient.
  429.     #
  430.     def xpathEval(self, expr):
  431.         doc = self.doc
  432.         if doc == None:
  433.             return None
  434.         ctxt = doc.xpathNewContext()
  435.         ctxt.setContextNode(self)
  436.         res = ctxt.xpathEval(expr)
  437.         ctxt.xpathFreeContext()
  438.         return res
  439.  
  440. #    #
  441. #    # Selecting nodes using XPath, faster because the context
  442. #    # is allocated just once per xmlDoc.
  443. #    #
  444. #    # Removed: DV memleaks c.f. #126735
  445. #    #
  446. #    def xpathEval2(self, expr):
  447. #        doc = self.doc
  448. #        if doc == None:
  449. #            return None
  450. #        try:
  451. #            doc._ctxt.setContextNode(self)
  452. #        except:
  453. #            doc._ctxt = doc.xpathNewContext()
  454. #            doc._ctxt.setContextNode(self)
  455. #        res = doc._ctxt.xpathEval(expr)
  456. #        return res
  457.     def xpathEval2(self, expr):
  458.         return self.xpathEval(expr)
  459.  
  460.     # Remove namespaces
  461.     def removeNsDef(self, href):
  462.         """
  463.         Remove a namespace definition from a node.  If href is None,
  464.         remove all of the ns definitions on that node.  The removed
  465.         namespaces are returned as a linked list.
  466.  
  467.         Note: If any child nodes referred to the removed namespaces,
  468.         they will be left with dangling links.  You should call
  469.         renconciliateNs() to fix those pointers.
  470.  
  471.         Note: This method does not free memory taken by the ns
  472.         definitions.  You will need to free it manually with the
  473.         freeNsList() method on the returns xmlNs object.
  474.         """
  475.  
  476.         ret = libxml2mod.xmlNodeRemoveNsDef(self._o, href)
  477.         if ret is None:return None
  478.         __tmp = xmlNs(_obj=ret)
  479.         return __tmp
  480.  
  481.     # support for python2 iterators
  482.     def walk_depth_first(self):
  483.         return xmlCoreDepthFirstItertor(self)
  484.     def walk_breadth_first(self):
  485.         return xmlCoreBreadthFirstItertor(self)
  486.     __iter__ = walk_depth_first
  487.  
  488.     def free(self):
  489.         try:
  490.             self.doc._ctxt.xpathFreeContext()
  491.         except:
  492.             pass
  493.         libxml2mod.xmlFreeDoc(self._o)
  494.  
  495.  
  496. #
  497. # implements the depth-first iterator for libxml2 DOM tree
  498. #
  499. class xmlCoreDepthFirstItertor:
  500.     def __init__(self, node):
  501.         self.node = node
  502.         self.parents = []
  503.     def __iter__(self):
  504.         return self
  505.     def next(self):
  506.         while 1:
  507.             if self.node:
  508.                 ret = self.node
  509.                 self.parents.append(self.node)
  510.                 self.node = self.node.children
  511.                 return ret
  512.             try:
  513.                 parent = self.parents.pop()
  514.             except IndexError:
  515.                 raise StopIteration
  516.             self.node = parent.next
  517.  
  518. #
  519. # implements the breadth-first iterator for libxml2 DOM tree
  520. #
  521. class xmlCoreBreadthFirstItertor:
  522.     def __init__(self, node):
  523.         self.node = node
  524.         self.parents = []
  525.     def __iter__(self):
  526.         return self
  527.     def next(self):
  528.         while 1:
  529.             if self.node:
  530.                 ret = self.node
  531.                 self.parents.append(self.node)
  532.                 self.node = self.node.next
  533.                 return ret
  534.             try:
  535.                 parent = self.parents.pop()
  536.             except IndexError:
  537.                 raise StopIteration
  538.             self.node = parent.children
  539.  
  540. #
  541. # converters to present a nicer view of the XPath returns
  542. #
  543. def nodeWrap(o):
  544.     # TODO try to cast to the most appropriate node class
  545.     name = libxml2mod.type(o)
  546.     if name == "element" or name == "text":
  547.         return xmlNode(_obj=o)
  548.     if name == "attribute":
  549.         return xmlAttr(_obj=o)
  550.     if name[0:8] == "document":
  551.         return xmlDoc(_obj=o)
  552.     if name == "namespace":
  553.         return xmlNs(_obj=o)
  554.     if name == "elem_decl":
  555.         return xmlElement(_obj=o)
  556.     if name == "attribute_decl":
  557.         return xmlAttribute(_obj=o)
  558.     if name == "entity_decl":
  559.         return xmlEntity(_obj=o)
  560.     if name == "dtd":
  561.         return xmlDtd(_obj=o)
  562.     return xmlNode(_obj=o)
  563.  
  564. def xpathObjectRet(o):
  565.     otype = type(o)
  566.     if otype == type([]):
  567.         ret = map(xpathObjectRet, o)
  568.         return ret
  569.     elif otype == type(()):
  570.         ret = map(xpathObjectRet, o)
  571.         return tuple(ret)
  572.     elif otype == type('') or otype == type(0) or otype == type(0.0):
  573.         return o
  574.     else:
  575.         return nodeWrap(o)
  576.  
  577. #
  578. # register an XPath function
  579. #
  580. def registerXPathFunction(ctxt, name, ns_uri, f):
  581.     ret = libxml2mod.xmlRegisterXPathFunction(ctxt, name, ns_uri, f)
  582.  
  583. #
  584. # For the xmlTextReader parser configuration
  585. #
  586. PARSER_LOADDTD=1
  587. PARSER_DEFAULTATTRS=2
  588. PARSER_VALIDATE=3
  589. PARSER_SUBST_ENTITIES=4
  590.  
  591. #
  592. # For the error callback severities
  593. #
  594. PARSER_SEVERITY_VALIDITY_WARNING=1
  595. PARSER_SEVERITY_VALIDITY_ERROR=2
  596. PARSER_SEVERITY_WARNING=3
  597. PARSER_SEVERITY_ERROR=4
  598.  
  599. #
  600. # register the libxml2 error handler
  601. #
  602. def registerErrorHandler(f, ctx):
  603.     """Register a Python written function to for error reporting.
  604.        The function is called back as f(ctx, error). """
  605.     import sys
  606.     if not sys.modules.has_key('libxslt'):
  607.         # normal behaviour when libxslt is not imported
  608.         ret = libxml2mod.xmlRegisterErrorHandler(f,ctx)
  609.     else:
  610.         # when libxslt is already imported, one must
  611.         # use libxst's error handler instead
  612.         import libxslt
  613.         ret = libxslt.registerErrorHandler(f,ctx)
  614.     return ret
  615.  
  616. class parserCtxtCore:
  617.  
  618.     def __init__(self, _obj=None):
  619.         if _obj != None: 
  620.             self._o = _obj;
  621.             return
  622.         self._o = None
  623.  
  624.     def __del__(self):
  625.         if self._o != None:
  626.             libxml2mod.xmlFreeParserCtxt(self._o)
  627.         self._o = None
  628.  
  629.     def setErrorHandler(self,f,arg):
  630.         """Register an error handler that will be called back as
  631.            f(arg,msg,severity,reserved).
  632.            
  633.            @reserved is currently always None."""
  634.         libxml2mod.xmlParserCtxtSetErrorHandler(self._o,f,arg)
  635.  
  636.     def getErrorHandler(self):
  637.         """Return (f,arg) as previously registered with setErrorHandler
  638.            or (None,None)."""
  639.         return libxml2mod.xmlParserCtxtGetErrorHandler(self._o)
  640.  
  641.     def addLocalCatalog(self, uri):
  642.         """Register a local catalog with the parser"""
  643.         return libxml2mod.addLocalCatalog(self._o, uri)
  644.     
  645.  
  646. class ValidCtxtCore:
  647.  
  648.     def __init__(self, *args, **kw):
  649.         pass
  650.  
  651.     def setValidityErrorHandler(self, err_func, warn_func, arg=None):
  652.         """
  653.         Register error and warning handlers for DTD validation.
  654.         These will be called back as f(msg,arg)
  655.         """
  656.         libxml2mod.xmlSetValidErrors(self._o, err_func, warn_func, arg)
  657.     
  658.  
  659. class SchemaValidCtxtCore:
  660.  
  661.     def __init__(self, *args, **kw):
  662.         pass
  663.  
  664.     def setValidityErrorHandler(self, err_func, warn_func, arg=None):
  665.         """
  666.         Register error and warning handlers for Schema validation.
  667.         These will be called back as f(msg,arg)
  668.         """
  669.         libxml2mod.xmlSchemaSetValidErrors(self._o, err_func, warn_func, arg)
  670.  
  671.  
  672. class relaxNgValidCtxtCore:
  673.  
  674.     def __init__(self, *args, **kw):
  675.         pass
  676.  
  677.     def setValidityErrorHandler(self, err_func, warn_func, arg=None):
  678.         """
  679.         Register error and warning handlers for RelaxNG validation.
  680.         These will be called back as f(msg,arg)
  681.         """
  682.         libxml2mod.xmlRelaxNGSetValidErrors(self._o, err_func, warn_func, arg)
  683.  
  684.     
  685. def _xmlTextReaderErrorFunc((f,arg),msg,severity,locator):
  686.     """Intermediate callback to wrap the locator"""
  687.     return f(arg,msg,severity,xmlTextReaderLocator(locator))
  688.  
  689. class xmlTextReaderCore:
  690.  
  691.     def __init__(self, _obj=None):
  692.         self.input = None
  693.         if _obj != None:self._o = _obj;return
  694.         self._o = None
  695.  
  696.     def __del__(self):
  697.         if self._o != None:
  698.             libxml2mod.xmlFreeTextReader(self._o)
  699.         self._o = None
  700.  
  701.     def SetErrorHandler(self,f,arg):
  702.         """Register an error handler that will be called back as
  703.            f(arg,msg,severity,locator)."""
  704.         if f is None:
  705.             libxml2mod.xmlTextReaderSetErrorHandler(\
  706.                 self._o,None,None)
  707.         else:
  708.             libxml2mod.xmlTextReaderSetErrorHandler(\
  709.                 self._o,_xmlTextReaderErrorFunc,(f,arg))
  710.  
  711.     def GetErrorHandler(self):
  712.         """Return (f,arg) as previously registered with setErrorHandler
  713.            or (None,None)."""
  714.         f,arg = libxml2mod.xmlTextReaderGetErrorHandler(self._o)
  715.         if f is None:
  716.             return None,None
  717.         else:
  718.             # assert f is _xmlTextReaderErrorFunc
  719.             return arg
  720.  
  721. #
  722. # The cleanup now goes though a wrappe in libxml.c
  723. #
  724. def cleanupParser():
  725.     libxml2mod.xmlPythonCleanupParser()
  726.  
  727. # WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING
  728. #
  729. # Everything before this line comes from libxml.py 
  730. # Everything after this line is automatically generated
  731. #
  732. # WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING
  733.  
  734. #
  735. # Functions from module HTMLparser
  736. #
  737.  
  738. def htmlCreateMemoryParserCtxt(buffer, size):
  739.     """Create a parser context for an HTML in-memory document. """
  740.     ret = libxml2mod.htmlCreateMemoryParserCtxt(buffer, size)
  741.     if ret is None:raise parserError('htmlCreateMemoryParserCtxt() failed')
  742.     return parserCtxt(_obj=ret)
  743.  
  744. def htmlHandleOmittedElem(val):
  745.     """Set and return the previous value for handling HTML omitted
  746.        tags. """
  747.     ret = libxml2mod.htmlHandleOmittedElem(val)
  748.     return ret
  749.  
  750. def htmlIsScriptAttribute(name):
  751.     """Check if an attribute is of content type Script """
  752.     ret = libxml2mod.htmlIsScriptAttribute(name)
  753.     return ret
  754.  
  755. def htmlNewParserCtxt():
  756.     """Allocate and initialize a new parser context. """
  757.     ret = libxml2mod.htmlNewParserCtxt()
  758.     if ret is None:raise parserError('htmlNewParserCtxt() failed')
  759.     return parserCtxt(_obj=ret)
  760.  
  761. def htmlParseDoc(cur, encoding):
  762.     """parse an HTML in-memory document and build a tree. """
  763.     ret = libxml2mod.htmlParseDoc(cur, encoding)
  764.     if ret is None:raise parserError('htmlParseDoc() failed')
  765.     return xmlDoc(_obj=ret)
  766.  
  767. def htmlParseFile(filename, encoding):
  768.     """parse an HTML file and build a tree. Automatic support for
  769.       ZLIB/Compress compressed document is provided by default if
  770.        found at compile-time. """
  771.     ret = libxml2mod.htmlParseFile(filename, encoding)
  772.     if ret is None:raise parserError('htmlParseFile() failed')
  773.     return xmlDoc(_obj=ret)
  774.  
  775. def htmlReadDoc(cur, URL, encoding, options):
  776.     """parse an XML in-memory document and build a tree. """
  777.     ret = libxml2mod.htmlReadDoc(cur, URL, encoding, options)
  778.     if ret is None:raise treeError('htmlReadDoc() failed')
  779.     return xmlDoc(_obj=ret)
  780.  
  781. def htmlReadFd(fd, URL, encoding, options):
  782.     """parse an XML from a file descriptor and build a tree. """
  783.     ret = libxml2mod.htmlReadFd(fd, URL, encoding, options)
  784.     if ret is None:raise treeError('htmlReadFd() failed')
  785.     return xmlDoc(_obj=ret)
  786.  
  787. def htmlReadFile(filename, encoding, options):
  788.     """parse an XML file from the filesystem or the network. """
  789.     ret = libxml2mod.htmlReadFile(filename, encoding, options)
  790.     if ret is None:raise treeError('htmlReadFile() failed')
  791.     return xmlDoc(_obj=ret)
  792.  
  793. def htmlReadMemory(buffer, size, URL, encoding, options):
  794.     """parse an XML in-memory document and build a tree. """
  795.     ret = libxml2mod.htmlReadMemory(buffer, size, URL, encoding, options)
  796.     if ret is None:raise treeError('htmlReadMemory() failed')
  797.     return xmlDoc(_obj=ret)
  798.  
  799. #
  800. # Functions from module HTMLtree
  801. #
  802.  
  803. def htmlIsBooleanAttr(name):
  804.     """Determine if a given attribute is a boolean attribute. """
  805.     ret = libxml2mod.htmlIsBooleanAttr(name)
  806.     return ret
  807.  
  808. def htmlNewDoc(URI, ExternalID):
  809.     """Creates a new HTML document """
  810.     ret = libxml2mod.htmlNewDoc(URI, ExternalID)
  811.     if ret is None:raise treeError('htmlNewDoc() failed')
  812.     return xmlDoc(_obj=ret)
  813.  
  814. def htmlNewDocNoDtD(URI, ExternalID):
  815.     """Creates a new HTML document without a DTD node if @URI and
  816.        @ExternalID are None """
  817.     ret = libxml2mod.htmlNewDocNoDtD(URI, ExternalID)
  818.     if ret is None:raise treeError('htmlNewDocNoDtD() failed')
  819.     return xmlDoc(_obj=ret)
  820.  
  821. #
  822. # Functions from module SAX2
  823. #
  824.  
  825. def SAXDefaultVersion(version):
  826.     """Set the default version of SAX used globally by the
  827.       library. By default, during initialization the default is
  828.       set to 2. Note that it is generally a better coding style
  829.       to use xmlSAXVersion() to set up the version explicitly for
  830.        a given parsing context. """
  831.     ret = libxml2mod.xmlSAXDefaultVersion(version)
  832.     return ret
  833.  
  834. def defaultSAXHandlerInit():
  835.     """Initialize the default SAX2 handler """
  836.     libxml2mod.xmlDefaultSAXHandlerInit()
  837.  
  838. def docbDefaultSAXHandlerInit():
  839.     """Initialize the default SAX handler """
  840.     libxml2mod.docbDefaultSAXHandlerInit()
  841.  
  842. def htmlDefaultSAXHandlerInit():
  843.     """Initialize the default SAX handler """
  844.     libxml2mod.htmlDefaultSAXHandlerInit()
  845.  
  846. #
  847. # Functions from module catalog
  848. #
  849.  
  850. def catalogAdd(type, orig, replace):
  851.     """Add an entry in the catalog, it may overwrite existing but
  852.       different entries. If called before any other catalog
  853.       routine, allows to override the default shared catalog put
  854.        in place by xmlInitializeCatalog(); """
  855.     ret = libxml2mod.xmlCatalogAdd(type, orig, replace)
  856.     return ret
  857.  
  858. def catalogCleanup():
  859.     """Free up all the memory associated with catalogs """
  860.     libxml2mod.xmlCatalogCleanup()
  861.  
  862. def catalogConvert():
  863.     """Convert all the SGML catalog entries as XML ones """
  864.     ret = libxml2mod.xmlCatalogConvert()
  865.     return ret
  866.  
  867. def catalogDump(out):
  868.     """Dump all the global catalog content to the given file. """
  869.     libxml2mod.xmlCatalogDump(out)
  870.  
  871. def catalogGetPublic(pubID):
  872.     """Try to lookup the catalog reference associated to a public
  873.        ID DEPRECATED, use xmlCatalogResolvePublic() """
  874.     ret = libxml2mod.xmlCatalogGetPublic(pubID)
  875.     return ret
  876.  
  877. def catalogGetSystem(sysID):
  878.     """Try to lookup the catalog reference associated to a system
  879.        ID DEPRECATED, use xmlCatalogResolveSystem() """
  880.     ret = libxml2mod.xmlCatalogGetSystem(sysID)
  881.     return ret
  882.  
  883. def catalogRemove(value):
  884.     """Remove an entry from the catalog """
  885.     ret = libxml2mod.xmlCatalogRemove(value)
  886.     return ret
  887.  
  888. def catalogResolve(pubID, sysID):
  889.     """Do a complete resolution lookup of an External Identifier """
  890.     ret = libxml2mod.xmlCatalogResolve(pubID, sysID)
  891.     return ret
  892.  
  893. def catalogResolvePublic(pubID):
  894.     """Try to lookup the catalog reference associated to a public
  895.        ID """
  896.     ret = libxml2mod.xmlCatalogResolvePublic(pubID)
  897.     return ret
  898.  
  899. def catalogResolveSystem(sysID):
  900.     """Try to lookup the catalog resource for a system ID """
  901.     ret = libxml2mod.xmlCatalogResolveSystem(sysID)
  902.     return ret
  903.  
  904. def catalogResolveURI(URI):
  905.     """Do a complete resolution lookup of an URI """
  906.     ret = libxml2mod.xmlCatalogResolveURI(URI)
  907.     return ret
  908.  
  909. def catalogSetDebug(level):
  910.     """Used to set the debug level for catalog operation, 0
  911.        disable debugging, 1 enable it """
  912.     ret = libxml2mod.xmlCatalogSetDebug(level)
  913.     return ret
  914.  
  915. def initializeCatalog():
  916.     """Do the catalog initialization. this function is not thread
  917.       safe, catalog initialization should preferably be done once
  918.        at startup """
  919.     libxml2mod.xmlInitializeCatalog()
  920.  
  921. def loadACatalog(filename):
  922.     """Load the catalog and build the associated data structures.
  923.       This can be either an XML Catalog or an SGML Catalog It
  924.       will recurse in SGML CATALOG entries. On the other hand XML
  925.        Catalogs are not handled recursively. """
  926.     ret = libxml2mod.xmlLoadACatalog(filename)
  927.     if ret is None:raise treeError('xmlLoadACatalog() failed')
  928.     return catalog(_obj=ret)
  929.  
  930. def loadCatalog(filename):
  931.     """Load the catalog and makes its definitions effective for
  932.       the default external entity loader. It will recurse in SGML
  933.       CATALOG entries. this function is not thread safe, catalog
  934.        initialization should preferably be done once at startup """
  935.     ret = libxml2mod.xmlLoadCatalog(filename)
  936.     return ret
  937.  
  938. def loadCatalogs(pathss):
  939.     """Load the catalogs and makes their definitions effective for
  940.       the default external entity loader. this function is not
  941.       thread safe, catalog initialization should preferably be
  942.        done once at startup """
  943.     libxml2mod.xmlLoadCatalogs(pathss)
  944.  
  945. def loadSGMLSuperCatalog(filename):
  946.     """Load an SGML super catalog. It won't expand CATALOG or
  947.       DELEGATE references. This is only needed for manipulating
  948.       SGML Super Catalogs like adding and removing CATALOG or
  949.        DELEGATE entries. """
  950.     ret = libxml2mod.xmlLoadSGMLSuperCatalog(filename)
  951.     if ret is None:raise treeError('xmlLoadSGMLSuperCatalog() failed')
  952.     return catalog(_obj=ret)
  953.  
  954. def newCatalog(sgml):
  955.     """create a new Catalog. """
  956.     ret = libxml2mod.xmlNewCatalog(sgml)
  957.     if ret is None:raise treeError('xmlNewCatalog() failed')
  958.     return catalog(_obj=ret)
  959.  
  960. def parseCatalogFile(filename):
  961.     """parse an XML file and build a tree. It's like
  962.        xmlParseFile() except it bypass all catalog lookups. """
  963.     ret = libxml2mod.xmlParseCatalogFile(filename)
  964.     if ret is None:raise parserError('xmlParseCatalogFile() failed')
  965.     return xmlDoc(_obj=ret)
  966.  
  967. #
  968. # Functions from module chvalid
  969. #
  970.  
  971. def isBaseChar(ch):
  972.     """This function is DEPRECATED. Use xmlIsBaseChar_ch or
  973.        xmlIsBaseCharQ instead """
  974.     ret = libxml2mod.xmlIsBaseChar(ch)
  975.     return ret
  976.  
  977. def isBlank(ch):
  978.     """This function is DEPRECATED. Use xmlIsBlank_ch or
  979.        xmlIsBlankQ instead """
  980.     ret = libxml2mod.xmlIsBlank(ch)
  981.     return ret
  982.  
  983. def isChar(ch):
  984.     """This function is DEPRECATED. Use xmlIsChar_ch or xmlIsCharQ
  985.        instead """
  986.     ret = libxml2mod.xmlIsChar(ch)
  987.     return ret
  988.  
  989. def isCombining(ch):
  990.     """This function is DEPRECATED. Use xmlIsCombiningQ instead """
  991.     ret = libxml2mod.xmlIsCombining(ch)
  992.     return ret
  993.  
  994. def isDigit(ch):
  995.     """This function is DEPRECATED. Use xmlIsDigit_ch or
  996.        xmlIsDigitQ instead """
  997.     ret = libxml2mod.xmlIsDigit(ch)
  998.     return ret
  999.  
  1000. def isExtender(ch):
  1001.     """This function is DEPRECATED. Use xmlIsExtender_ch or
  1002.        xmlIsExtenderQ instead """
  1003.     ret = libxml2mod.xmlIsExtender(ch)
  1004.     return ret
  1005.  
  1006. def isIdeographic(ch):
  1007.     """This function is DEPRECATED. Use xmlIsIdeographicQ instead """
  1008.     ret = libxml2mod.xmlIsIdeographic(ch)
  1009.     return ret
  1010.  
  1011. def isPubidChar(ch):
  1012.     """This function is DEPRECATED. Use xmlIsPubidChar_ch or
  1013.        xmlIsPubidCharQ instead """
  1014.     ret = libxml2mod.xmlIsPubidChar(ch)
  1015.     return ret
  1016.  
  1017. #
  1018. # Functions from module debugXML
  1019. #
  1020.  
  1021. def boolToText(boolval):
  1022.     """Convenient way to turn bool into text """
  1023.     ret = libxml2mod.xmlBoolToText(boolval)
  1024.     return ret
  1025.  
  1026. def debugDumpString(output, str):
  1027.     """Dumps informations about the string, shorten it if necessary """
  1028.     libxml2mod.xmlDebugDumpString(output, str)
  1029.  
  1030. def shellPrintXPathError(errorType, arg):
  1031.     """Print the xpath error to libxml default error channel """
  1032.     libxml2mod.xmlShellPrintXPathError(errorType, arg)
  1033.  
  1034. #
  1035. # Functions from module dict
  1036. #
  1037.  
  1038. def dictCleanup():
  1039.     """Free the dictionary mutex. """
  1040.     libxml2mod.xmlDictCleanup()
  1041.  
  1042. #
  1043. # Functions from module encoding
  1044. #
  1045.  
  1046. def addEncodingAlias(name, alias):
  1047.     """Registers an alias @alias for an encoding named @name.
  1048.        Existing alias will be overwritten. """
  1049.     ret = libxml2mod.xmlAddEncodingAlias(name, alias)
  1050.     return ret
  1051.  
  1052. def cleanupCharEncodingHandlers():
  1053.     """Cleanup the memory allocated for the char encoding support,
  1054.        it unregisters all the encoding handlers and the aliases. """
  1055.     libxml2mod.xmlCleanupCharEncodingHandlers()
  1056.  
  1057. def cleanupEncodingAliases():
  1058.     """Unregisters all aliases """
  1059.     libxml2mod.xmlCleanupEncodingAliases()
  1060.  
  1061. def delEncodingAlias(alias):
  1062.     """Unregisters an encoding alias @alias """
  1063.     ret = libxml2mod.xmlDelEncodingAlias(alias)
  1064.     return ret
  1065.  
  1066. def encodingAlias(alias):
  1067.     """Lookup an encoding name for the given alias. """
  1068.     ret = libxml2mod.xmlGetEncodingAlias(alias)
  1069.     return ret
  1070.  
  1071. def initCharEncodingHandlers():
  1072.     """Initialize the char encoding support, it registers the
  1073.       default encoding supported. NOTE: while public, this
  1074.       function usually doesn't need to be called in normal
  1075.        processing. """
  1076.     libxml2mod.xmlInitCharEncodingHandlers()
  1077.  
  1078. #
  1079. # Functions from module entities
  1080. #
  1081.  
  1082. def cleanupPredefinedEntities():
  1083.     """Cleanup up the predefined entities table. Deprecated call """
  1084.     libxml2mod.xmlCleanupPredefinedEntities()
  1085.  
  1086. def initializePredefinedEntities():
  1087.     """Set up the predefined entities. Deprecated call """
  1088.     libxml2mod.xmlInitializePredefinedEntities()
  1089.  
  1090. def predefinedEntity(name):
  1091.     """Check whether this name is an predefined entity. """
  1092.     ret = libxml2mod.xmlGetPredefinedEntity(name)
  1093.     if ret is None:raise treeError('xmlGetPredefinedEntity() failed')
  1094.     return xmlEntity(_obj=ret)
  1095.  
  1096. #
  1097. # Functions from module globals
  1098. #
  1099.  
  1100. def cleanupGlobals():
  1101.     """Additional cleanup for multi-threading """
  1102.     libxml2mod.xmlCleanupGlobals()
  1103.  
  1104. def initGlobals():
  1105.     """Additional initialisation for multi-threading """
  1106.     libxml2mod.xmlInitGlobals()
  1107.  
  1108. def thrDefDefaultBufferSize(v):
  1109.     ret = libxml2mod.xmlThrDefDefaultBufferSize(v)
  1110.     return ret
  1111.  
  1112. def thrDefDoValidityCheckingDefaultValue(v):
  1113.     ret = libxml2mod.xmlThrDefDoValidityCheckingDefaultValue(v)
  1114.     return ret
  1115.  
  1116. def thrDefGetWarningsDefaultValue(v):
  1117.     ret = libxml2mod.xmlThrDefGetWarningsDefaultValue(v)
  1118.     return ret
  1119.  
  1120. def thrDefIndentTreeOutput(v):
  1121.     ret = libxml2mod.xmlThrDefIndentTreeOutput(v)
  1122.     return ret
  1123.  
  1124. def thrDefKeepBlanksDefaultValue(v):
  1125.     ret = libxml2mod.xmlThrDefKeepBlanksDefaultValue(v)
  1126.     return ret
  1127.  
  1128. def thrDefLineNumbersDefaultValue(v):
  1129.     ret = libxml2mod.xmlThrDefLineNumbersDefaultValue(v)
  1130.     return ret
  1131.  
  1132. def thrDefLoadExtDtdDefaultValue(v):
  1133.     ret = libxml2mod.xmlThrDefLoadExtDtdDefaultValue(v)
  1134.     return ret
  1135.  
  1136. def thrDefParserDebugEntities(v):
  1137.     ret = libxml2mod.xmlThrDefParserDebugEntities(v)
  1138.     return ret
  1139.  
  1140. def thrDefPedanticParserDefaultValue(v):
  1141.     ret = libxml2mod.xmlThrDefPedanticParserDefaultValue(v)
  1142.     return ret
  1143.  
  1144. def thrDefSaveNoEmptyTags(v):
  1145.     ret = libxml2mod.xmlThrDefSaveNoEmptyTags(v)
  1146.     return ret
  1147.  
  1148. def thrDefSubstituteEntitiesDefaultValue(v):
  1149.     ret = libxml2mod.xmlThrDefSubstituteEntitiesDefaultValue(v)
  1150.     return ret
  1151.  
  1152. def thrDefTreeIndentString(v):
  1153.     ret = libxml2mod.xmlThrDefTreeIndentString(v)
  1154.     return ret
  1155.  
  1156. #
  1157. # Functions from module nanoftp
  1158. #
  1159.  
  1160. def nanoFTPCleanup():
  1161.     """Cleanup the FTP protocol layer. This cleanup proxy
  1162.        informations. """
  1163.     libxml2mod.xmlNanoFTPCleanup()
  1164.  
  1165. def nanoFTPInit():
  1166.     """Initialize the FTP protocol layer. Currently it just checks
  1167.        for proxy informations, and get the hostname """
  1168.     libxml2mod.xmlNanoFTPInit()
  1169.  
  1170. def nanoFTPProxy(host, port, user, passwd, type):
  1171.     """Setup the FTP proxy informations. This can also be done by
  1172.       using ftp_proxy ftp_proxy_user and ftp_proxy_password
  1173.        environment variables. """
  1174.     libxml2mod.xmlNanoFTPProxy(host, port, user, passwd, type)
  1175.  
  1176. def nanoFTPScanProxy(URL):
  1177.     """(Re)Initialize the FTP Proxy context by parsing the URL and
  1178.       finding the protocol host port it indicates. Should be like
  1179.       ftp://myproxy/ or ftp://myproxy:3128/ A None URL cleans up
  1180.        proxy informations. """
  1181.     libxml2mod.xmlNanoFTPScanProxy(URL)
  1182.  
  1183. #
  1184. # Functions from module nanohttp
  1185. #
  1186.  
  1187. def nanoHTTPCleanup():
  1188.     """Cleanup the HTTP protocol layer. """
  1189.     libxml2mod.xmlNanoHTTPCleanup()
  1190.  
  1191. def nanoHTTPInit():
  1192.     """Initialize the HTTP protocol layer. Currently it just
  1193.        checks for proxy informations """
  1194.     libxml2mod.xmlNanoHTTPInit()
  1195.  
  1196. def nanoHTTPScanProxy(URL):
  1197.     """(Re)Initialize the HTTP Proxy context by parsing the URL
  1198.       and finding the protocol host port it indicates. Should be
  1199.       like http://myproxy/ or http://myproxy:3128/ A None URL
  1200.        cleans up proxy informations. """
  1201.     libxml2mod.xmlNanoHTTPScanProxy(URL)
  1202.  
  1203. #
  1204. # Functions from module parser
  1205. #
  1206.  
  1207. def createDocParserCtxt(cur):
  1208.     """Creates a parser context for an XML in-memory document. """
  1209.     ret = libxml2mod.xmlCreateDocParserCtxt(cur)
  1210.     if ret is None:raise parserError('xmlCreateDocParserCtxt() failed')
  1211.     return parserCtxt(_obj=ret)
  1212.  
  1213. def initParser():
  1214.     """Initialization function for the XML parser. This is not
  1215.       reentrant. Call once before processing in case of use in
  1216.        multithreaded programs. """
  1217.     libxml2mod.xmlInitParser()
  1218.  
  1219. def keepBlanksDefault(val):
  1220.     """Set and return the previous value for default blanks text
  1221.       nodes support. The 1.x version of the parser used an
  1222.       heuristic to try to detect ignorable white spaces. As a
  1223.       result the SAX callback was generating
  1224.       xmlSAX2IgnorableWhitespace() callbacks instead of
  1225.       characters() one, and when using the DOM output text nodes
  1226.       containing those blanks were not generated. The 2.x and
  1227.       later version will switch to the XML standard way and
  1228.       ignorableWhitespace() are only generated when running the
  1229.       parser in validating mode and when the current element
  1230.       doesn't allow CDATA or mixed content. This function is
  1231.       provided as a way to force the standard behavior on 1.X
  1232.       libs and to switch back to the old mode for compatibility
  1233.       when running 1.X client code on 2.X . Upgrade of 1.X code
  1234.       should be done by using xmlIsBlankNode() commodity function
  1235.       to detect the "empty" nodes generated. This value also
  1236.       affect autogeneration of indentation when saving code if
  1237.        blanks sections are kept, indentation is not generated. """
  1238.     ret = libxml2mod.xmlKeepBlanksDefault(val)
  1239.     return ret
  1240.  
  1241. def lineNumbersDefault(val):
  1242.     """Set and return the previous value for enabling line numbers
  1243.       in elements contents. This may break on old application and
  1244.        is turned off by default. """
  1245.     ret = libxml2mod.xmlLineNumbersDefault(val)
  1246.     return ret
  1247.  
  1248. def newParserCtxt():
  1249.     """Allocate and initialize a new parser context. """
  1250.     ret = libxml2mod.xmlNewParserCtxt()
  1251.     if ret is None:raise parserError('xmlNewParserCtxt() failed')
  1252.     return parserCtxt(_obj=ret)
  1253.  
  1254. def parseDTD(ExternalID, SystemID):
  1255.     """Load and parse an external subset. """
  1256.     ret = libxml2mod.xmlParseDTD(ExternalID, SystemID)
  1257.     if ret is None:raise parserError('xmlParseDTD() failed')
  1258.     return xmlDtd(_obj=ret)
  1259.  
  1260. def parseDoc(cur):
  1261.     """parse an XML in-memory document and build a tree. """
  1262.     ret = libxml2mod.xmlParseDoc(cur)
  1263.     if ret is None:raise parserError('xmlParseDoc() failed')
  1264.     return xmlDoc(_obj=ret)
  1265.  
  1266. def parseEntity(filename):
  1267.     """parse an XML external entity out of context and build a
  1268.       tree.  [78] extParsedEnt ::= TextDecl? content  This
  1269.        correspond to a "Well Balanced" chunk """
  1270.     ret = libxml2mod.xmlParseEntity(filename)
  1271.     if ret is None:raise parserError('xmlParseEntity() failed')
  1272.     return xmlDoc(_obj=ret)
  1273.  
  1274. def parseFile(filename):
  1275.     """parse an XML file and build a tree. Automatic support for
  1276.       ZLIB/Compress compressed document is provided by default if
  1277.        found at compile-time. """
  1278.     ret = libxml2mod.xmlParseFile(filename)
  1279.     if ret is None:raise parserError('xmlParseFile() failed')
  1280.     return xmlDoc(_obj=ret)
  1281.  
  1282. def parseMemory(buffer, size):
  1283.     """parse an XML in-memory block and build a tree. """
  1284.     ret = libxml2mod.xmlParseMemory(buffer, size)
  1285.     if ret is None:raise parserError('xmlParseMemory() failed')
  1286.     return xmlDoc(_obj=ret)
  1287.  
  1288. def pedanticParserDefault(val):
  1289.     """Set and return the previous value for enabling pedantic
  1290.        warnings. """
  1291.     ret = libxml2mod.xmlPedanticParserDefault(val)
  1292.     return ret
  1293.  
  1294. def readDoc(cur, URL, encoding, options):
  1295.     """parse an XML in-memory document and build a tree. """
  1296.     ret = libxml2mod.xmlReadDoc(cur, URL, encoding, options)
  1297.     if ret is None:raise treeError('xmlReadDoc() failed')
  1298.     return xmlDoc(_obj=ret)
  1299.  
  1300. def readFd(fd, URL, encoding, options):
  1301.     """parse an XML from a file descriptor and build a tree. NOTE
  1302.       that the file descriptor will not be closed when the reader
  1303.        is closed or reset. """
  1304.     ret = libxml2mod.xmlReadFd(fd, URL, encoding, options)
  1305.     if ret is None:raise treeError('xmlReadFd() failed')
  1306.     return xmlDoc(_obj=ret)
  1307.  
  1308. def readFile(filename, encoding, options):
  1309.     """parse an XML file from the filesystem or the network. """
  1310.     ret = libxml2mod.xmlReadFile(filename, encoding, options)
  1311.     if ret is None:raise treeError('xmlReadFile() failed')
  1312.     return xmlDoc(_obj=ret)
  1313.  
  1314. def readMemory(buffer, size, URL, encoding, options):
  1315.     """parse an XML in-memory document and build a tree. """
  1316.     ret = libxml2mod.xmlReadMemory(buffer, size, URL, encoding, options)
  1317.     if ret is None:raise treeError('xmlReadMemory() failed')
  1318.     return xmlDoc(_obj=ret)
  1319.  
  1320. def recoverDoc(cur):
  1321.     """parse an XML in-memory document and build a tree. In the
  1322.       case the document is not Well Formed, a attempt to build a
  1323.        tree is tried anyway """
  1324.     ret = libxml2mod.xmlRecoverDoc(cur)
  1325.     if ret is None:raise treeError('xmlRecoverDoc() failed')
  1326.     return xmlDoc(_obj=ret)
  1327.  
  1328. def recoverFile(filename):
  1329.     """parse an XML file and build a tree. Automatic support for
  1330.       ZLIB/Compress compressed document is provided by default if
  1331.       found at compile-time. In the case the document is not Well
  1332.        Formed, it attempts to build a tree anyway """
  1333.     ret = libxml2mod.xmlRecoverFile(filename)
  1334.     if ret is None:raise treeError('xmlRecoverFile() failed')
  1335.     return xmlDoc(_obj=ret)
  1336.  
  1337. def recoverMemory(buffer, size):
  1338.     """parse an XML in-memory block and build a tree. In the case
  1339.       the document is not Well Formed, an attempt to build a tree
  1340.        is tried anyway """
  1341.     ret = libxml2mod.xmlRecoverMemory(buffer, size)
  1342.     if ret is None:raise treeError('xmlRecoverMemory() failed')
  1343.     return xmlDoc(_obj=ret)
  1344.  
  1345. def substituteEntitiesDefault(val):
  1346.     """Set and return the previous value for default entity
  1347.       support. Initially the parser always keep entity references
  1348.       instead of substituting entity values in the output. This
  1349.       function has to be used to change the default parser
  1350.       behavior SAX::substituteEntities() has to be used for
  1351.        changing that on a file by file basis. """
  1352.     ret = libxml2mod.xmlSubstituteEntitiesDefault(val)
  1353.     return ret
  1354.  
  1355. #
  1356. # Functions from module parserInternals
  1357. #
  1358.  
  1359. def checkLanguageID(lang):
  1360.     """Checks that the value conforms to the LanguageID
  1361.       production:  NOTE: this is somewhat deprecated, those
  1362.       productions were removed from the XML Second edition.  [33]
  1363.       LanguageID ::= Langcode ('-' Subcode)* [34] Langcode ::=
  1364.       ISO639Code |  IanaCode |  UserCode [35] ISO639Code ::=
  1365.       ([a-z] | [A-Z]) ([a-z] | [A-Z]) [36] IanaCode ::= ('i' |
  1366.       'I') '-' ([a-z] | [A-Z])+ [37] UserCode ::= ('x' | 'X') '-'
  1367.       ([a-z] | [A-Z])+ [38] Subcode ::= ([a-z] | [A-Z])+  The
  1368.       current REC reference the sucessors of RFC 1766, currently
  1369.       5646  http://www.rfc-editor.org/rfc/rfc5646.txt langtag    
  1370.       = language ["-" script] ["-" region] *("-" variant) *("-"
  1371.       extension) ["-" privateuse] language      = 2*3ALPHA       
  1372.       ; shortest ISO 639 code ["-" extlang]       ; sometimes
  1373.       followed by ; extended language subtags / 4ALPHA           
  1374.       ; or reserved for future use / 5*8ALPHA            ; or
  1375.       registered language subtag  extlang       = 3ALPHA         
  1376.       ; selected ISO 639 codes *2("-" 3ALPHA)      ; permanently
  1377.       reserved  script        = 4ALPHA              ; ISO 15924
  1378.       code  region        = 2ALPHA              ; ISO 3166-1 code
  1379.       / 3DIGIT              ; UN M.49 code  variant       =
  1380.       5*8alphanum         ; registered variants / (DIGIT
  1381.       3alphanum)  extension     = singleton 1*("-" (2*8alphanum))
  1382.       ; Single alphanumerics ; "x" reserved for private use
  1383.       singleton     = DIGIT               ; 0 - 9 / %x41-57      
  1384.       ; A - W / %x59-5A             ; Y - Z / %x61-77            
  1385.       ; a - w / %x79-7A             ; y - z  it sounds right to
  1386.       still allow Irregular i-xxx IANA and user codes too The
  1387.       parser below doesn't try to cope with extension or
  1388.       privateuse that could be added but that's not interoperable
  1389.        anyway """
  1390.     ret = libxml2mod.xmlCheckLanguageID(lang)
  1391.     return ret
  1392.  
  1393. def copyChar(len, out, val):
  1394.     """append the char value in the array """
  1395.     ret = libxml2mod.xmlCopyChar(len, out, val)
  1396.     return ret
  1397.  
  1398. def copyCharMultiByte(out, val):
  1399.     """append the char value in the array """
  1400.     ret = libxml2mod.xmlCopyCharMultiByte(out, val)
  1401.     return ret
  1402.  
  1403. def createEntityParserCtxt(URL, ID, base):
  1404.     """Create a parser context for an external entity Automatic
  1405.       support for ZLIB/Compress compressed document is provided
  1406.        by default if found at compile-time. """
  1407.     ret = libxml2mod.xmlCreateEntityParserCtxt(URL, ID, base)
  1408.     if ret is None:raise parserError('xmlCreateEntityParserCtxt() failed')
  1409.     return parserCtxt(_obj=ret)
  1410.  
  1411. def createFileParserCtxt(filename):
  1412.     """Create a parser context for a file content. Automatic
  1413.       support for ZLIB/Compress compressed document is provided
  1414.        by default if found at compile-time. """
  1415.     ret = libxml2mod.xmlCreateFileParserCtxt(filename)
  1416.     if ret is None:raise parserError('xmlCreateFileParserCtxt() failed')
  1417.     return parserCtxt(_obj=ret)
  1418.  
  1419. def createMemoryParserCtxt(buffer, size):
  1420.     """Create a parser context for an XML in-memory document. """
  1421.     ret = libxml2mod.xmlCreateMemoryParserCtxt(buffer, size)
  1422.     if ret is None:raise parserError('xmlCreateMemoryParserCtxt() failed')
  1423.     return parserCtxt(_obj=ret)
  1424.  
  1425. def createURLParserCtxt(filename, options):
  1426.     """Create a parser context for a file or URL content.
  1427.       Automatic support for ZLIB/Compress compressed document is
  1428.       provided by default if found at compile-time and for file
  1429.        accesses """
  1430.     ret = libxml2mod.xmlCreateURLParserCtxt(filename, options)
  1431.     if ret is None:raise parserError('xmlCreateURLParserCtxt() failed')
  1432.     return parserCtxt(_obj=ret)
  1433.  
  1434. def htmlCreateFileParserCtxt(filename, encoding):
  1435.     """Create a parser context for a file content. Automatic
  1436.       support for ZLIB/Compress compressed document is provided
  1437.        by default if found at compile-time. """
  1438.     ret = libxml2mod.htmlCreateFileParserCtxt(filename, encoding)
  1439.     if ret is None:raise parserError('htmlCreateFileParserCtxt() failed')
  1440.     return parserCtxt(_obj=ret)
  1441.  
  1442. def htmlInitAutoClose():
  1443.     """Initialize the htmlStartCloseIndex for fast lookup of
  1444.       closing tags names. This is not reentrant. Call
  1445.       xmlInitParser() once before processing in case of use in
  1446.        multithreaded programs. """
  1447.     libxml2mod.htmlInitAutoClose()
  1448.  
  1449. def isLetter(c):
  1450.     """Check whether the character is allowed by the production
  1451.        [84] Letter ::= BaseChar | Ideographic """
  1452.     ret = libxml2mod.xmlIsLetter(c)
  1453.     return ret
  1454.  
  1455. def namePop(ctxt):
  1456.     """Pops the top element name from the name stack """
  1457.     if ctxt is None: ctxt__o = None
  1458.     else: ctxt__o = ctxt._o
  1459.     ret = libxml2mod.namePop(ctxt__o)
  1460.     return ret
  1461.  
  1462. def namePush(ctxt, value):
  1463.     """Pushes a new element name on top of the name stack """
  1464.     if ctxt is None: ctxt__o = None
  1465.     else: ctxt__o = ctxt._o
  1466.     ret = libxml2mod.namePush(ctxt__o, value)
  1467.     return ret
  1468.  
  1469. def nodePop(ctxt):
  1470.     """Pops the top element node from the node stack """
  1471.     if ctxt is None: ctxt__o = None
  1472.     else: ctxt__o = ctxt._o
  1473.     ret = libxml2mod.nodePop(ctxt__o)
  1474.     if ret is None:raise treeError('nodePop() failed')
  1475.     return xmlNode(_obj=ret)
  1476.  
  1477. def nodePush(ctxt, value):
  1478.     """Pushes a new element node on top of the node stack """
  1479.     if ctxt is None: ctxt__o = None
  1480.     else: ctxt__o = ctxt._o
  1481.     if value is None: value__o = None
  1482.     else: value__o = value._o
  1483.     ret = libxml2mod.nodePush(ctxt__o, value__o)
  1484.     return ret
  1485.  
  1486. #
  1487. # Functions from module python
  1488. #
  1489.  
  1490. def SAXParseFile(SAX, URI, recover):
  1491.     """Interface to parse an XML file or resource pointed by an
  1492.        URI to build an event flow to the SAX object """
  1493.     libxml2mod.xmlSAXParseFile(SAX, URI, recover)
  1494.  
  1495. def createInputBuffer(file, encoding):
  1496.     """Create a libxml2 input buffer from a Python file """
  1497.     ret = libxml2mod.xmlCreateInputBuffer(file, encoding)
  1498.     if ret is None:raise treeError('xmlCreateInputBuffer() failed')
  1499.     return inputBuffer(_obj=ret)
  1500.  
  1501. def createOutputBuffer(file, encoding):
  1502.     """Create a libxml2 output buffer from a Python file """
  1503.     ret = libxml2mod.xmlCreateOutputBuffer(file, encoding)
  1504.     if ret is None:raise treeError('xmlCreateOutputBuffer() failed')
  1505.     return outputBuffer(_obj=ret)
  1506.  
  1507. def createPushParser(SAX, chunk, size, URI):
  1508.     """Create a progressive XML parser context to build either an
  1509.       event flow if the SAX object is not None, or a DOM tree
  1510.        otherwise. """
  1511.     ret = libxml2mod.xmlCreatePushParser(SAX, chunk, size, URI)
  1512.     if ret is None:raise parserError('xmlCreatePushParser() failed')
  1513.     return parserCtxt(_obj=ret)
  1514.  
  1515. def debugMemory(activate):
  1516.     """Switch on the generation of line number for elements nodes.
  1517.       Also returns the number of bytes allocated and not freed by
  1518.        libxml2 since memory debugging was switched on. """
  1519.     ret = libxml2mod.xmlDebugMemory(activate)
  1520.     return ret
  1521.  
  1522. def dumpMemory():
  1523.     """dump the memory allocated in the file .memdump """
  1524.     libxml2mod.xmlDumpMemory()
  1525.  
  1526. def htmlCreatePushParser(SAX, chunk, size, URI):
  1527.     """Create a progressive HTML parser context to build either an
  1528.       event flow if the SAX object is not None, or a DOM tree
  1529.        otherwise. """
  1530.     ret = libxml2mod.htmlCreatePushParser(SAX, chunk, size, URI)
  1531.     if ret is None:raise parserError('htmlCreatePushParser() failed')
  1532.     return parserCtxt(_obj=ret)
  1533.  
  1534. def htmlSAXParseFile(SAX, URI, encoding):
  1535.     """Interface to parse an HTML file or resource pointed by an
  1536.        URI to build an event flow to the SAX object """
  1537.     libxml2mod.htmlSAXParseFile(SAX, URI, encoding)
  1538.  
  1539. def memoryUsed():
  1540.     """Returns the total amount of memory allocated by libxml2 """
  1541.     ret = libxml2mod.xmlMemoryUsed()
  1542.     return ret
  1543.  
  1544. def newNode(name):
  1545.     """Create a new Node """
  1546.     ret = libxml2mod.xmlNewNode(name)
  1547.     if ret is None:raise treeError('xmlNewNode() failed')
  1548.     return xmlNode(_obj=ret)
  1549.  
  1550. def pythonCleanupParser():
  1551.     """Cleanup function for the XML library. It tries to reclaim
  1552.       all parsing related global memory allocated for the library
  1553.       processing. It doesn't deallocate any document related
  1554.       memory. Calling this function should not prevent reusing
  1555.       the library but one should call xmlCleanupParser() only
  1556.       when the process has finished using the library or XML
  1557.        document built with it. """
  1558.     libxml2mod.xmlPythonCleanupParser()
  1559.  
  1560. def setEntityLoader(resolver):
  1561.     """Set the entity resolver as a python function """
  1562.     ret = libxml2mod.xmlSetEntityLoader(resolver)
  1563.     return ret
  1564.  
  1565. #
  1566. # Functions from module relaxng
  1567. #
  1568.  
  1569. def relaxNGCleanupTypes():
  1570.     """Cleanup the default Schemas type library associated to
  1571.        RelaxNG """
  1572.     libxml2mod.xmlRelaxNGCleanupTypes()
  1573.  
  1574. def relaxNGInitTypes():
  1575.     """Initilize the default type libraries. """
  1576.     ret = libxml2mod.xmlRelaxNGInitTypes()
  1577.     return ret
  1578.  
  1579. def relaxNGNewMemParserCtxt(buffer, size):
  1580.     """Create an XML RelaxNGs parse context for that memory buffer
  1581.        expected to contain an XML RelaxNGs file. """
  1582.     ret = libxml2mod.xmlRelaxNGNewMemParserCtxt(buffer, size)
  1583.     if ret is None:raise parserError('xmlRelaxNGNewMemParserCtxt() failed')
  1584.     return relaxNgParserCtxt(_obj=ret)
  1585.  
  1586. def relaxNGNewParserCtxt(URL):
  1587.     """Create an XML RelaxNGs parse context for that file/resource
  1588.        expected to contain an XML RelaxNGs file. """
  1589.     ret = libxml2mod.xmlRelaxNGNewParserCtxt(URL)
  1590.     if ret is None:raise parserError('xmlRelaxNGNewParserCtxt() failed')
  1591.     return relaxNgParserCtxt(_obj=ret)
  1592.  
  1593. #
  1594. # Functions from module tree
  1595. #
  1596.  
  1597. def buildQName(ncname, prefix, memory, len):
  1598.     """Builds the QName @prefix:@ncname in @memory if there is
  1599.       enough space and prefix is not None nor empty, otherwise
  1600.       allocate a new string. If prefix is None or empty it
  1601.        returns ncname. """
  1602.     ret = libxml2mod.xmlBuildQName(ncname, prefix, memory, len)
  1603.     return ret
  1604.  
  1605. def compressMode():
  1606.     """get the default compression mode used, ZLIB based. """
  1607.     ret = libxml2mod.xmlGetCompressMode()
  1608.     return ret
  1609.  
  1610. def isXHTML(systemID, publicID):
  1611.     """Try to find if the document correspond to an XHTML DTD """
  1612.     ret = libxml2mod.xmlIsXHTML(systemID, publicID)
  1613.     return ret
  1614.  
  1615. def newComment(content):
  1616.     """Creation of a new node containing a comment. """
  1617.     ret = libxml2mod.xmlNewComment(content)
  1618.     if ret is None:raise treeError('xmlNewComment() failed')
  1619.     return xmlNode(_obj=ret)
  1620.  
  1621. def newDoc(version):
  1622.     """Creates a new XML document """
  1623.     ret = libxml2mod.xmlNewDoc(version)
  1624.     if ret is None:raise treeError('xmlNewDoc() failed')
  1625.     return xmlDoc(_obj=ret)
  1626.  
  1627. def newPI(name, content):
  1628.     """Creation of a processing instruction element. Use
  1629.        xmlDocNewPI preferably to get string interning """
  1630.     ret = libxml2mod.xmlNewPI(name, content)
  1631.     if ret is None:raise treeError('xmlNewPI() failed')
  1632.     return xmlNode(_obj=ret)
  1633.  
  1634. def newText(content):
  1635.     """Creation of a new text node. """
  1636.     ret = libxml2mod.xmlNewText(content)
  1637.     if ret is None:raise treeError('xmlNewText() failed')
  1638.     return xmlNode(_obj=ret)
  1639.  
  1640. def newTextLen(content, len):
  1641.     """Creation of a new text node with an extra parameter for the
  1642.        content's length """
  1643.     ret = libxml2mod.xmlNewTextLen(content, len)
  1644.     if ret is None:raise treeError('xmlNewTextLen() failed')
  1645.     return xmlNode(_obj=ret)
  1646.  
  1647. def setCompressMode(mode):
  1648.     """set the default compression mode used, ZLIB based Correct
  1649.        values: 0 (uncompressed) to 9 (max compression) """
  1650.     libxml2mod.xmlSetCompressMode(mode)
  1651.  
  1652. def validateNCName(value, space):
  1653.     """Check that a value conforms to the lexical space of NCName """
  1654.     ret = libxml2mod.xmlValidateNCName(value, space)
  1655.     return ret
  1656.  
  1657. def validateNMToken(value, space):
  1658.     """Check that a value conforms to the lexical space of NMToken """
  1659.     ret = libxml2mod.xmlValidateNMToken(value, space)
  1660.     return ret
  1661.  
  1662. def validateName(value, space):
  1663.     """Check that a value conforms to the lexical space of Name """
  1664.     ret = libxml2mod.xmlValidateName(value, space)
  1665.     return ret
  1666.  
  1667. def validateQName(value, space):
  1668.     """Check that a value conforms to the lexical space of QName """
  1669.     ret = libxml2mod.xmlValidateQName(value, space)
  1670.     return ret
  1671.  
  1672. #
  1673. # Functions from module uri
  1674. #
  1675.  
  1676. def URIEscape(str):
  1677.     """Escaping routine, does not do validity checks ! It will try
  1678.       to escape the chars needing this, but this is heuristic
  1679.        based it's impossible to be sure. """
  1680.     ret = libxml2mod.xmlURIEscape(str)
  1681.     return ret
  1682.  
  1683. def URIEscapeStr(str, list):
  1684.     """This routine escapes a string to hex, ignoring reserved
  1685.        characters (a-z) and the characters in the exception list. """
  1686.     ret = libxml2mod.xmlURIEscapeStr(str, list)
  1687.     return ret
  1688.  
  1689. def URIUnescapeString(str, len, target):
  1690.     """Unescaping routine, but does not check that the string is
  1691.       an URI. The output is a direct unsigned char translation of
  1692.       %XX values (no encoding) Note that the length of the result
  1693.        can only be smaller or same size as the input string. """
  1694.     ret = libxml2mod.xmlURIUnescapeString(str, len, target)
  1695.     return ret
  1696.  
  1697. def buildRelativeURI(URI, base):
  1698.     """Expresses the URI of the reference in terms relative to the
  1699.       base.  Some examples of this operation include: base =
  1700.       "http://site1.com/docs/book1.html" URI input               
  1701.       URI returned docs/pic1.gif                    pic1.gif
  1702.       docs/img/pic1.gif                img/pic1.gif img/pic1.gif 
  1703.       ../img/pic1.gif http://site1.com/docs/pic1.gif   pic1.gif
  1704.       http://site2.com/docs/pic1.gif  
  1705.       http://site2.com/docs/pic1.gif  base = "docs/book1.html"
  1706.       URI input                        URI returned docs/pic1.gif
  1707.       pic1.gif docs/img/pic1.gif                img/pic1.gif
  1708.       img/pic1.gif                     ../img/pic1.gif
  1709.       http://site1.com/docs/pic1.gif  
  1710.       http://site1.com/docs/pic1.gif   Note: if the URI reference
  1711.       is really wierd or complicated, it may be worthwhile to
  1712.       first convert it into a "nice" one by calling xmlBuildURI
  1713.       (using 'base') before calling this routine, since this
  1714.       routine (for reasonable efficiency) assumes URI has already
  1715.        been through some validation. """
  1716.     ret = libxml2mod.xmlBuildRelativeURI(URI, base)
  1717.     return ret
  1718.  
  1719. def buildURI(URI, base):
  1720.     """Computes he final URI of the reference done by checking
  1721.       that the given URI is valid, and building the final URI
  1722.       using the base URI. This is processed according to section
  1723.       5.2 of the RFC 2396  5.2. Resolving Relative References to
  1724.        Absolute Form """
  1725.     ret = libxml2mod.xmlBuildURI(URI, base)
  1726.     return ret
  1727.  
  1728. def canonicPath(path):
  1729.     """Constructs a canonic path from the specified path. """
  1730.     ret = libxml2mod.xmlCanonicPath(path)
  1731.     return ret
  1732.  
  1733. def createURI():
  1734.     """Simply creates an empty xmlURI """
  1735.     ret = libxml2mod.xmlCreateURI()
  1736.     if ret is None:raise uriError('xmlCreateURI() failed')
  1737.     return URI(_obj=ret)
  1738.  
  1739. def normalizeURIPath(path):
  1740.     """Applies the 5 normalization steps to a path string--that
  1741.       is, RFC 2396 Section 5.2, steps 6.c through 6.g. 
  1742.       Normalization occurs directly on the string, no new
  1743.        allocation is done """
  1744.     ret = libxml2mod.xmlNormalizeURIPath(path)
  1745.     return ret
  1746.  
  1747. def parseURI(str):
  1748.     """Parse an URI based on RFC 3986  URI-reference = [
  1749.        absoluteURI | relativeURI ] [ "#" fragment ] """
  1750.     ret = libxml2mod.xmlParseURI(str)
  1751.     if ret is None:raise uriError('xmlParseURI() failed')
  1752.     return URI(_obj=ret)
  1753.  
  1754. def parseURIRaw(str, raw):
  1755.     """Parse an URI but allows to keep intact the original
  1756.        fragments.  URI-reference = URI / relative-ref """
  1757.     ret = libxml2mod.xmlParseURIRaw(str, raw)
  1758.     if ret is None:raise uriError('xmlParseURIRaw() failed')
  1759.     return URI(_obj=ret)
  1760.  
  1761. def pathToURI(path):
  1762.     """Constructs an URI expressing the existing path """
  1763.     ret = libxml2mod.xmlPathToURI(path)
  1764.     return ret
  1765.  
  1766. #
  1767. # Functions from module valid
  1768. #
  1769.  
  1770. def newValidCtxt():
  1771.     """Allocate a validation context structure. """
  1772.     ret = libxml2mod.xmlNewValidCtxt()
  1773.     if ret is None:raise treeError('xmlNewValidCtxt() failed')
  1774.     return ValidCtxt(_obj=ret)
  1775.  
  1776. def validateNameValue(value):
  1777.     """Validate that the given value match Name production """
  1778.     ret = libxml2mod.xmlValidateNameValue(value)
  1779.     return ret
  1780.  
  1781. def validateNamesValue(value):
  1782.     """Validate that the given value match Names production """
  1783.     ret = libxml2mod.xmlValidateNamesValue(value)
  1784.     return ret
  1785.  
  1786. def validateNmtokenValue(value):
  1787.     """Validate that the given value match Nmtoken production  [
  1788.        VC: Name Token ] """
  1789.     ret = libxml2mod.xmlValidateNmtokenValue(value)
  1790.     return ret
  1791.  
  1792. def validateNmtokensValue(value):
  1793.     """Validate that the given value match Nmtokens production  [
  1794.        VC: Name Token ] """
  1795.     ret = libxml2mod.xmlValidateNmtokensValue(value)
  1796.     return ret
  1797.  
  1798. #
  1799. # Functions from module xmlIO
  1800. #
  1801.  
  1802. def checkFilename(path):
  1803.     """function checks to see if @path is a valid source (file,
  1804.       socket...) for XML.  if stat is not available on the target
  1805.        machine, """
  1806.     ret = libxml2mod.xmlCheckFilename(path)
  1807.     return ret
  1808.  
  1809. def cleanupInputCallbacks():
  1810.     """clears the entire input callback table. this includes the
  1811.        compiled-in I/O. """
  1812.     libxml2mod.xmlCleanupInputCallbacks()
  1813.  
  1814. def cleanupOutputCallbacks():
  1815.     """clears the entire output callback table. this includes the
  1816.        compiled-in I/O callbacks. """
  1817.     libxml2mod.xmlCleanupOutputCallbacks()
  1818.  
  1819. def fileMatch(filename):
  1820.     """input from FILE * """
  1821.     ret = libxml2mod.xmlFileMatch(filename)
  1822.     return ret
  1823.  
  1824. def iOFTPMatch(filename):
  1825.     """check if the URI matches an FTP one """
  1826.     ret = libxml2mod.xmlIOFTPMatch(filename)
  1827.     return ret
  1828.  
  1829. def iOHTTPMatch(filename):
  1830.     """check if the URI matches an HTTP one """
  1831.     ret = libxml2mod.xmlIOHTTPMatch(filename)
  1832.     return ret
  1833.  
  1834. def normalizeWindowsPath(path):
  1835.     """This function is obsolete. Please see xmlURIFromPath in
  1836.        uri.c for a better solution. """
  1837.     ret = libxml2mod.xmlNormalizeWindowsPath(path)
  1838.     return ret
  1839.  
  1840. def parserGetDirectory(filename):
  1841.     """lookup the directory for that file """
  1842.     ret = libxml2mod.xmlParserGetDirectory(filename)
  1843.     return ret
  1844.  
  1845. def popInputCallbacks():
  1846.     """Clear the top input callback from the input stack. this
  1847.        includes the compiled-in I/O. """
  1848.     ret = libxml2mod.xmlPopInputCallbacks()
  1849.     return ret
  1850.  
  1851. def registerDefaultInputCallbacks():
  1852.     """Registers the default compiled-in I/O handlers. """
  1853.     libxml2mod.xmlRegisterDefaultInputCallbacks()
  1854.  
  1855. def registerDefaultOutputCallbacks():
  1856.     """Registers the default compiled-in I/O handlers. """
  1857.     libxml2mod.xmlRegisterDefaultOutputCallbacks()
  1858.  
  1859. def registerHTTPPostCallbacks():
  1860.     """By default, libxml submits HTTP output requests using the
  1861.       "PUT" method. Calling this method changes the HTTP output
  1862.        method to use the "POST" method instead. """
  1863.     libxml2mod.xmlRegisterHTTPPostCallbacks()
  1864.  
  1865. #
  1866. # Functions from module xmlerror
  1867. #
  1868.  
  1869. def lastError():
  1870.     """Get the last global error registered. This is per thread if
  1871.        compiled with thread support. """
  1872.     ret = libxml2mod.xmlGetLastError()
  1873.     if ret is None:raise treeError('xmlGetLastError() failed')
  1874.     return Error(_obj=ret)
  1875.  
  1876. def resetLastError():
  1877.     """Cleanup the last global error registered. For parsing error
  1878.        this does not change the well-formedness result. """
  1879.     libxml2mod.xmlResetLastError()
  1880.  
  1881. #
  1882. # Functions from module xmlreader
  1883. #
  1884.  
  1885. def newTextReaderFilename(URI):
  1886.     """Create an xmlTextReader structure fed with the resource at
  1887.        @URI """
  1888.     ret = libxml2mod.xmlNewTextReaderFilename(URI)
  1889.     if ret is None:raise treeError('xmlNewTextReaderFilename() failed')
  1890.     return xmlTextReader(_obj=ret)
  1891.  
  1892. def readerForDoc(cur, URL, encoding, options):
  1893.     """Create an xmltextReader for an XML in-memory document. The
  1894.       parsing flags @options are a combination of xmlParserOption. """
  1895.     ret = libxml2mod.xmlReaderForDoc(cur, URL, encoding, options)
  1896.     if ret is None:raise treeError('xmlReaderForDoc() failed')
  1897.     return xmlTextReader(_obj=ret)
  1898.  
  1899. def readerForFd(fd, URL, encoding, options):
  1900.     """Create an xmltextReader for an XML from a file descriptor.
  1901.       The parsing flags @options are a combination of
  1902.       xmlParserOption. NOTE that the file descriptor will not be
  1903.        closed when the reader is closed or reset. """
  1904.     ret = libxml2mod.xmlReaderForFd(fd, URL, encoding, options)
  1905.     if ret is None:raise treeError('xmlReaderForFd() failed')
  1906.     return xmlTextReader(_obj=ret)
  1907.  
  1908. def readerForFile(filename, encoding, options):
  1909.     """parse an XML file from the filesystem or the network. The
  1910.       parsing flags @options are a combination of xmlParserOption. """
  1911.     ret = libxml2mod.xmlReaderForFile(filename, encoding, options)
  1912.     if ret is None:raise treeError('xmlReaderForFile() failed')
  1913.     return xmlTextReader(_obj=ret)
  1914.  
  1915. def readerForMemory(buffer, size, URL, encoding, options):
  1916.     """Create an xmltextReader for an XML in-memory document. The
  1917.       parsing flags @options are a combination of xmlParserOption. """
  1918.     ret = libxml2mod.xmlReaderForMemory(buffer, size, URL, encoding, options)
  1919.     if ret is None:raise treeError('xmlReaderForMemory() failed')
  1920.     return xmlTextReader(_obj=ret)
  1921.  
  1922. #
  1923. # Functions from module xmlregexp
  1924. #
  1925.  
  1926. def regexpCompile(regexp):
  1927.     """Parses a regular expression conforming to XML Schemas Part
  1928.       2 Datatype Appendix F and builds an automata suitable for
  1929.        testing strings against that regular expression """
  1930.     ret = libxml2mod.xmlRegexpCompile(regexp)
  1931.     if ret is None:raise treeError('xmlRegexpCompile() failed')
  1932.     return xmlReg(_obj=ret)
  1933.  
  1934. #
  1935. # Functions from module xmlschemas
  1936. #
  1937.  
  1938. def schemaNewMemParserCtxt(buffer, size):
  1939.     """Create an XML Schemas parse context for that memory buffer
  1940.        expected to contain an XML Schemas file. """
  1941.     ret = libxml2mod.xmlSchemaNewMemParserCtxt(buffer, size)
  1942.     if ret is None:raise parserError('xmlSchemaNewMemParserCtxt() failed')
  1943.     return SchemaParserCtxt(_obj=ret)
  1944.  
  1945. def schemaNewParserCtxt(URL):
  1946.     """Create an XML Schemas parse context for that file/resource
  1947.        expected to contain an XML Schemas file. """
  1948.     ret = libxml2mod.xmlSchemaNewParserCtxt(URL)
  1949.     if ret is None:raise parserError('xmlSchemaNewParserCtxt() failed')
  1950.     return SchemaParserCtxt(_obj=ret)
  1951.  
  1952. #
  1953. # Functions from module xmlschemastypes
  1954. #
  1955.  
  1956. def schemaCleanupTypes():
  1957.     """Cleanup the default XML Schemas type library """
  1958.     libxml2mod.xmlSchemaCleanupTypes()
  1959.  
  1960. def schemaCollapseString(value):
  1961.     """Removes and normalize white spaces in the string """
  1962.     ret = libxml2mod.xmlSchemaCollapseString(value)
  1963.     return ret
  1964.  
  1965. def schemaInitTypes():
  1966.     """Initialize the default XML Schemas type library """
  1967.     libxml2mod.xmlSchemaInitTypes()
  1968.  
  1969. def schemaWhiteSpaceReplace(value):
  1970.     """Replaces 0xd, 0x9 and 0xa with a space. """
  1971.     ret = libxml2mod.xmlSchemaWhiteSpaceReplace(value)
  1972.     return ret
  1973.  
  1974. #
  1975. # Functions from module xmlstring
  1976. #
  1977.  
  1978. def UTF8Charcmp(utf1, utf2):
  1979.     """compares the two UCS4 values """
  1980.     ret = libxml2mod.xmlUTF8Charcmp(utf1, utf2)
  1981.     return ret
  1982.  
  1983. def UTF8Size(utf):
  1984.     """calculates the internal size of a UTF8 character """
  1985.     ret = libxml2mod.xmlUTF8Size(utf)
  1986.     return ret
  1987.  
  1988. def UTF8Strlen(utf):
  1989.     """compute the length of an UTF8 string, it doesn't do a full
  1990.        UTF8 checking of the content of the string. """
  1991.     ret = libxml2mod.xmlUTF8Strlen(utf)
  1992.     return ret
  1993.  
  1994. def UTF8Strloc(utf, utfchar):
  1995.     """a function to provide the relative location of a UTF8 char """
  1996.     ret = libxml2mod.xmlUTF8Strloc(utf, utfchar)
  1997.     return ret
  1998.  
  1999. def UTF8Strndup(utf, len):
  2000.     """a strndup for array of UTF8's """
  2001.     ret = libxml2mod.xmlUTF8Strndup(utf, len)
  2002.     return ret
  2003.  
  2004. def UTF8Strpos(utf, pos):
  2005.     """a function to provide the equivalent of fetching a
  2006.        character from a string array """
  2007.     ret = libxml2mod.xmlUTF8Strpos(utf, pos)
  2008.     return ret
  2009.  
  2010. def UTF8Strsize(utf, len):
  2011.     """storage size of an UTF8 string the behaviour is not
  2012.        garanteed if the input string is not UTF-8 """
  2013.     ret = libxml2mod.xmlUTF8Strsize(utf, len)
  2014.     return ret
  2015.  
  2016. def UTF8Strsub(utf, start, len):
  2017.     """Create a substring from a given UTF-8 string Note: 
  2018.        positions are given in units of UTF-8 chars """
  2019.     ret = libxml2mod.xmlUTF8Strsub(utf, start, len)
  2020.     return ret
  2021.  
  2022. def checkUTF8(utf):
  2023.     """Checks @utf for being valid UTF-8. @utf is assumed to be
  2024.       null-terminated. This function is not super-strict, as it
  2025.       will allow longer UTF-8 sequences than necessary. Note that
  2026.       Java is capable of producing these sequences if provoked.
  2027.       Also note, this routine checks for the 4-byte maximum size,
  2028.        but does not check for 0x10ffff maximum value. """
  2029.     ret = libxml2mod.xmlCheckUTF8(utf)
  2030.     return ret
  2031.  
  2032. #
  2033. # Functions from module xmlunicode
  2034. #
  2035.  
  2036. def uCSIsAegeanNumbers(code):
  2037.     """Check whether the character is part of AegeanNumbers UCS
  2038.        Block """
  2039.     ret = libxml2mod.xmlUCSIsAegeanNumbers(code)
  2040.     return ret
  2041.  
  2042. def uCSIsAlphabeticPresentationForms(code):
  2043.     """Check whether the character is part of
  2044.        AlphabeticPresentationForms UCS Block """
  2045.     ret = libxml2mod.xmlUCSIsAlphabeticPresentationForms(code)
  2046.     return ret
  2047.  
  2048. def uCSIsArabic(code):
  2049.     """Check whether the character is part of Arabic UCS Block """
  2050.     ret = libxml2mod.xmlUCSIsArabic(code)
  2051.     return ret
  2052.  
  2053. def uCSIsArabicPresentationFormsA(code):
  2054.     """Check whether the character is part of
  2055.        ArabicPresentationForms-A UCS Block """
  2056.     ret = libxml2mod.xmlUCSIsArabicPresentationFormsA(code)
  2057.     return ret
  2058.  
  2059. def uCSIsArabicPresentationFormsB(code):
  2060.     """Check whether the character is part of
  2061.        ArabicPresentationForms-B UCS Block """
  2062.     ret = libxml2mod.xmlUCSIsArabicPresentationFormsB(code)
  2063.     return ret
  2064.  
  2065. def uCSIsArmenian(code):
  2066.     """Check whether the character is part of Armenian UCS Block """
  2067.     ret = libxml2mod.xmlUCSIsArmenian(code)
  2068.     return ret
  2069.  
  2070. def uCSIsArrows(code):
  2071.     """Check whether the character is part of Arrows UCS Block """
  2072.     ret = libxml2mod.xmlUCSIsArrows(code)
  2073.     return ret
  2074.  
  2075. def uCSIsBasicLatin(code):
  2076.     """Check whether the character is part of BasicLatin UCS Block """
  2077.     ret = libxml2mod.xmlUCSIsBasicLatin(code)
  2078.     return ret
  2079.  
  2080. def uCSIsBengali(code):
  2081.     """Check whether the character is part of Bengali UCS Block """
  2082.     ret = libxml2mod.xmlUCSIsBengali(code)
  2083.     return ret
  2084.  
  2085. def uCSIsBlock(code, block):
  2086.     """Check whether the character is part of the UCS Block """
  2087.     ret = libxml2mod.xmlUCSIsBlock(code, block)
  2088.     return ret
  2089.  
  2090. def uCSIsBlockElements(code):
  2091.     """Check whether the character is part of BlockElements UCS
  2092.        Block """
  2093.     ret = libxml2mod.xmlUCSIsBlockElements(code)
  2094.     return ret
  2095.  
  2096. def uCSIsBopomofo(code):
  2097.     """Check whether the character is part of Bopomofo UCS Block """
  2098.     ret = libxml2mod.xmlUCSIsBopomofo(code)
  2099.     return ret
  2100.  
  2101. def uCSIsBopomofoExtended(code):
  2102.     """Check whether the character is part of BopomofoExtended UCS
  2103.        Block """
  2104.     ret = libxml2mod.xmlUCSIsBopomofoExtended(code)
  2105.     return ret
  2106.  
  2107. def uCSIsBoxDrawing(code):
  2108.     """Check whether the character is part of BoxDrawing UCS Block """
  2109.     ret = libxml2mod.xmlUCSIsBoxDrawing(code)
  2110.     return ret
  2111.  
  2112. def uCSIsBraillePatterns(code):
  2113.     """Check whether the character is part of BraillePatterns UCS
  2114.        Block """
  2115.     ret = libxml2mod.xmlUCSIsBraillePatterns(code)
  2116.     return ret
  2117.  
  2118. def uCSIsBuhid(code):
  2119.     """Check whether the character is part of Buhid UCS Block """
  2120.     ret = libxml2mod.xmlUCSIsBuhid(code)
  2121.     return ret
  2122.  
  2123. def uCSIsByzantineMusicalSymbols(code):
  2124.     """Check whether the character is part of
  2125.        ByzantineMusicalSymbols UCS Block """
  2126.     ret = libxml2mod.xmlUCSIsByzantineMusicalSymbols(code)
  2127.     return ret
  2128.  
  2129. def uCSIsCJKCompatibility(code):
  2130.     """Check whether the character is part of CJKCompatibility UCS
  2131.        Block """
  2132.     ret = libxml2mod.xmlUCSIsCJKCompatibility(code)
  2133.     return ret
  2134.  
  2135. def uCSIsCJKCompatibilityForms(code):
  2136.     """Check whether the character is part of
  2137.        CJKCompatibilityForms UCS Block """
  2138.     ret = libxml2mod.xmlUCSIsCJKCompatibilityForms(code)
  2139.     return ret
  2140.  
  2141. def uCSIsCJKCompatibilityIdeographs(code):
  2142.     """Check whether the character is part of
  2143.        CJKCompatibilityIdeographs UCS Block """
  2144.     ret = libxml2mod.xmlUCSIsCJKCompatibilityIdeographs(code)
  2145.     return ret
  2146.  
  2147. def uCSIsCJKCompatibilityIdeographsSupplement(code):
  2148.     """Check whether the character is part of
  2149.        CJKCompatibilityIdeographsSupplement UCS Block """
  2150.     ret = libxml2mod.xmlUCSIsCJKCompatibilityIdeographsSupplement(code)
  2151.     return ret
  2152.  
  2153. def uCSIsCJKRadicalsSupplement(code):
  2154.     """Check whether the character is part of
  2155.        CJKRadicalsSupplement UCS Block """
  2156.     ret = libxml2mod.xmlUCSIsCJKRadicalsSupplement(code)
  2157.     return ret
  2158.  
  2159. def uCSIsCJKSymbolsandPunctuation(code):
  2160.     """Check whether the character is part of
  2161.        CJKSymbolsandPunctuation UCS Block """
  2162.     ret = libxml2mod.xmlUCSIsCJKSymbolsandPunctuation(code)
  2163.     return ret
  2164.  
  2165. def uCSIsCJKUnifiedIdeographs(code):
  2166.     """Check whether the character is part of CJKUnifiedIdeographs
  2167.        UCS Block """
  2168.     ret = libxml2mod.xmlUCSIsCJKUnifiedIdeographs(code)
  2169.     return ret
  2170.  
  2171. def uCSIsCJKUnifiedIdeographsExtensionA(code):
  2172.     """Check whether the character is part of
  2173.        CJKUnifiedIdeographsExtensionA UCS Block """
  2174.     ret = libxml2mod.xmlUCSIsCJKUnifiedIdeographsExtensionA(code)
  2175.     return ret
  2176.  
  2177. def uCSIsCJKUnifiedIdeographsExtensionB(code):
  2178.     """Check whether the character is part of
  2179.        CJKUnifiedIdeographsExtensionB UCS Block """
  2180.     ret = libxml2mod.xmlUCSIsCJKUnifiedIdeographsExtensionB(code)
  2181.     return ret
  2182.  
  2183. def uCSIsCat(code, cat):
  2184.     """Check whether the character is part of the UCS Category """
  2185.     ret = libxml2mod.xmlUCSIsCat(code, cat)
  2186.     return ret
  2187.  
  2188. def uCSIsCatC(code):
  2189.     """Check whether the character is part of C UCS Category """
  2190.     ret = libxml2mod.xmlUCSIsCatC(code)
  2191.     return ret
  2192.  
  2193. def uCSIsCatCc(code):
  2194.     """Check whether the character is part of Cc UCS Category """
  2195.     ret = libxml2mod.xmlUCSIsCatCc(code)
  2196.     return ret
  2197.  
  2198. def uCSIsCatCf(code):
  2199.     """Check whether the character is part of Cf UCS Category """
  2200.     ret = libxml2mod.xmlUCSIsCatCf(code)
  2201.     return ret
  2202.  
  2203. def uCSIsCatCo(code):
  2204.     """Check whether the character is part of Co UCS Category """
  2205.     ret = libxml2mod.xmlUCSIsCatCo(code)
  2206.     return ret
  2207.  
  2208. def uCSIsCatCs(code):
  2209.     """Check whether the character is part of Cs UCS Category """
  2210.     ret = libxml2mod.xmlUCSIsCatCs(code)
  2211.     return ret
  2212.  
  2213. def uCSIsCatL(code):
  2214.     """Check whether the character is part of L UCS Category """
  2215.     ret = libxml2mod.xmlUCSIsCatL(code)
  2216.     return ret
  2217.  
  2218. def uCSIsCatLl(code):
  2219.     """Check whether the character is part of Ll UCS Category """
  2220.     ret = libxml2mod.xmlUCSIsCatLl(code)
  2221.     return ret
  2222.  
  2223. def uCSIsCatLm(code):
  2224.     """Check whether the character is part of Lm UCS Category """
  2225.     ret = libxml2mod.xmlUCSIsCatLm(code)
  2226.     return ret
  2227.  
  2228. def uCSIsCatLo(code):
  2229.     """Check whether the character is part of Lo UCS Category """
  2230.     ret = libxml2mod.xmlUCSIsCatLo(code)
  2231.     return ret
  2232.  
  2233. def uCSIsCatLt(code):
  2234.     """Check whether the character is part of Lt UCS Category """
  2235.     ret = libxml2mod.xmlUCSIsCatLt(code)
  2236.     return ret
  2237.  
  2238. def uCSIsCatLu(code):
  2239.     """Check whether the character is part of Lu UCS Category """
  2240.     ret = libxml2mod.xmlUCSIsCatLu(code)
  2241.     return ret
  2242.  
  2243. def uCSIsCatM(code):
  2244.     """Check whether the character is part of M UCS Category """
  2245.     ret = libxml2mod.xmlUCSIsCatM(code)
  2246.     return ret
  2247.  
  2248. def uCSIsCatMc(code):
  2249.     """Check whether the character is part of Mc UCS Category """
  2250.     ret = libxml2mod.xmlUCSIsCatMc(code)
  2251.     return ret
  2252.  
  2253. def uCSIsCatMe(code):
  2254.     """Check whether the character is part of Me UCS Category """
  2255.     ret = libxml2mod.xmlUCSIsCatMe(code)
  2256.     return ret
  2257.  
  2258. def uCSIsCatMn(code):
  2259.     """Check whether the character is part of Mn UCS Category """
  2260.     ret = libxml2mod.xmlUCSIsCatMn(code)
  2261.     return ret
  2262.  
  2263. def uCSIsCatN(code):
  2264.     """Check whether the character is part of N UCS Category """
  2265.     ret = libxml2mod.xmlUCSIsCatN(code)
  2266.     return ret
  2267.  
  2268. def uCSIsCatNd(code):
  2269.     """Check whether the character is part of Nd UCS Category """
  2270.     ret = libxml2mod.xmlUCSIsCatNd(code)
  2271.     return ret
  2272.  
  2273. def uCSIsCatNl(code):
  2274.     """Check whether the character is part of Nl UCS Category """
  2275.     ret = libxml2mod.xmlUCSIsCatNl(code)
  2276.     return ret
  2277.  
  2278. def uCSIsCatNo(code):
  2279.     """Check whether the character is part of No UCS Category """
  2280.     ret = libxml2mod.xmlUCSIsCatNo(code)
  2281.     return ret
  2282.  
  2283. def uCSIsCatP(code):
  2284.     """Check whether the character is part of P UCS Category """
  2285.     ret = libxml2mod.xmlUCSIsCatP(code)
  2286.     return ret
  2287.  
  2288. def uCSIsCatPc(code):
  2289.     """Check whether the character is part of Pc UCS Category """
  2290.     ret = libxml2mod.xmlUCSIsCatPc(code)
  2291.     return ret
  2292.  
  2293. def uCSIsCatPd(code):
  2294.     """Check whether the character is part of Pd UCS Category """
  2295.     ret = libxml2mod.xmlUCSIsCatPd(code)
  2296.     return ret
  2297.  
  2298. def uCSIsCatPe(code):
  2299.     """Check whether the character is part of Pe UCS Category """
  2300.     ret = libxml2mod.xmlUCSIsCatPe(code)
  2301.     return ret
  2302.  
  2303. def uCSIsCatPf(code):
  2304.     """Check whether the character is part of Pf UCS Category """
  2305.     ret = libxml2mod.xmlUCSIsCatPf(code)
  2306.     return ret
  2307.  
  2308. def uCSIsCatPi(code):
  2309.     """Check whether the character is part of Pi UCS Category """
  2310.     ret = libxml2mod.xmlUCSIsCatPi(code)
  2311.     return ret
  2312.  
  2313. def uCSIsCatPo(code):
  2314.     """Check whether the character is part of Po UCS Category """
  2315.     ret = libxml2mod.xmlUCSIsCatPo(code)
  2316.     return ret
  2317.  
  2318. def uCSIsCatPs(code):
  2319.     """Check whether the character is part of Ps UCS Category """
  2320.     ret = libxml2mod.xmlUCSIsCatPs(code)
  2321.     return ret
  2322.  
  2323. def uCSIsCatS(code):
  2324.     """Check whether the character is part of S UCS Category """
  2325.     ret = libxml2mod.xmlUCSIsCatS(code)
  2326.     return ret
  2327.  
  2328. def uCSIsCatSc(code):
  2329.     """Check whether the character is part of Sc UCS Category """
  2330.     ret = libxml2mod.xmlUCSIsCatSc(code)
  2331.     return ret
  2332.  
  2333. def uCSIsCatSk(code):
  2334.     """Check whether the character is part of Sk UCS Category """
  2335.     ret = libxml2mod.xmlUCSIsCatSk(code)
  2336.     return ret
  2337.  
  2338. def uCSIsCatSm(code):
  2339.     """Check whether the character is part of Sm UCS Category """
  2340.     ret = libxml2mod.xmlUCSIsCatSm(code)
  2341.     return ret
  2342.  
  2343. def uCSIsCatSo(code):
  2344.     """Check whether the character is part of So UCS Category """
  2345.     ret = libxml2mod.xmlUCSIsCatSo(code)
  2346.     return ret
  2347.  
  2348. def uCSIsCatZ(code):
  2349.     """Check whether the character is part of Z UCS Category """
  2350.     ret = libxml2mod.xmlUCSIsCatZ(code)
  2351.     return ret
  2352.  
  2353. def uCSIsCatZl(code):
  2354.     """Check whether the character is part of Zl UCS Category """
  2355.     ret = libxml2mod.xmlUCSIsCatZl(code)
  2356.     return ret
  2357.  
  2358. def uCSIsCatZp(code):
  2359.     """Check whether the character is part of Zp UCS Category """
  2360.     ret = libxml2mod.xmlUCSIsCatZp(code)
  2361.     return ret
  2362.  
  2363. def uCSIsCatZs(code):
  2364.     """Check whether the character is part of Zs UCS Category """
  2365.     ret = libxml2mod.xmlUCSIsCatZs(code)
  2366.     return ret
  2367.  
  2368. def uCSIsCherokee(code):
  2369.     """Check whether the character is part of Cherokee UCS Block """
  2370.     ret = libxml2mod.xmlUCSIsCherokee(code)
  2371.     return ret
  2372.  
  2373. def uCSIsCombiningDiacriticalMarks(code):
  2374.     """Check whether the character is part of
  2375.        CombiningDiacriticalMarks UCS Block """
  2376.     ret = libxml2mod.xmlUCSIsCombiningDiacriticalMarks(code)
  2377.     return ret
  2378.  
  2379. def uCSIsCombiningDiacriticalMarksforSymbols(code):
  2380.     """Check whether the character is part of
  2381.        CombiningDiacriticalMarksforSymbols UCS Block """
  2382.     ret = libxml2mod.xmlUCSIsCombiningDiacriticalMarksforSymbols(code)
  2383.     return ret
  2384.  
  2385. def uCSIsCombiningHalfMarks(code):
  2386.     """Check whether the character is part of CombiningHalfMarks
  2387.        UCS Block """
  2388.     ret = libxml2mod.xmlUCSIsCombiningHalfMarks(code)
  2389.     return ret
  2390.  
  2391. def uCSIsCombiningMarksforSymbols(code):
  2392.     """Check whether the character is part of
  2393.        CombiningMarksforSymbols UCS Block """
  2394.     ret = libxml2mod.xmlUCSIsCombiningMarksforSymbols(code)
  2395.     return ret
  2396.  
  2397. def uCSIsControlPictures(code):
  2398.     """Check whether the character is part of ControlPictures UCS
  2399.        Block """
  2400.     ret = libxml2mod.xmlUCSIsControlPictures(code)
  2401.     return ret
  2402.  
  2403. def uCSIsCurrencySymbols(code):
  2404.     """Check whether the character is part of CurrencySymbols UCS
  2405.        Block """
  2406.     ret = libxml2mod.xmlUCSIsCurrencySymbols(code)
  2407.     return ret
  2408.  
  2409. def uCSIsCypriotSyllabary(code):
  2410.     """Check whether the character is part of CypriotSyllabary UCS
  2411.        Block """
  2412.     ret = libxml2mod.xmlUCSIsCypriotSyllabary(code)
  2413.     return ret
  2414.  
  2415. def uCSIsCyrillic(code):
  2416.     """Check whether the character is part of Cyrillic UCS Block """
  2417.     ret = libxml2mod.xmlUCSIsCyrillic(code)
  2418.     return ret
  2419.  
  2420. def uCSIsCyrillicSupplement(code):
  2421.     """Check whether the character is part of CyrillicSupplement
  2422.        UCS Block """
  2423.     ret = libxml2mod.xmlUCSIsCyrillicSupplement(code)
  2424.     return ret
  2425.  
  2426. def uCSIsDeseret(code):
  2427.     """Check whether the character is part of Deseret UCS Block """
  2428.     ret = libxml2mod.xmlUCSIsDeseret(code)
  2429.     return ret
  2430.  
  2431. def uCSIsDevanagari(code):
  2432.     """Check whether the character is part of Devanagari UCS Block """
  2433.     ret = libxml2mod.xmlUCSIsDevanagari(code)
  2434.     return ret
  2435.  
  2436. def uCSIsDingbats(code):
  2437.     """Check whether the character is part of Dingbats UCS Block """
  2438.     ret = libxml2mod.xmlUCSIsDingbats(code)
  2439.     return ret
  2440.  
  2441. def uCSIsEnclosedAlphanumerics(code):
  2442.     """Check whether the character is part of
  2443.        EnclosedAlphanumerics UCS Block """
  2444.     ret = libxml2mod.xmlUCSIsEnclosedAlphanumerics(code)
  2445.     return ret
  2446.  
  2447. def uCSIsEnclosedCJKLettersandMonths(code):
  2448.     """Check whether the character is part of
  2449.        EnclosedCJKLettersandMonths UCS Block """
  2450.     ret = libxml2mod.xmlUCSIsEnclosedCJKLettersandMonths(code)
  2451.     return ret
  2452.  
  2453. def uCSIsEthiopic(code):
  2454.     """Check whether the character is part of Ethiopic UCS Block """
  2455.     ret = libxml2mod.xmlUCSIsEthiopic(code)
  2456.     return ret
  2457.  
  2458. def uCSIsGeneralPunctuation(code):
  2459.     """Check whether the character is part of GeneralPunctuation
  2460.        UCS Block """
  2461.     ret = libxml2mod.xmlUCSIsGeneralPunctuation(code)
  2462.     return ret
  2463.  
  2464. def uCSIsGeometricShapes(code):
  2465.     """Check whether the character is part of GeometricShapes UCS
  2466.        Block """
  2467.     ret = libxml2mod.xmlUCSIsGeometricShapes(code)
  2468.     return ret
  2469.  
  2470. def uCSIsGeorgian(code):
  2471.     """Check whether the character is part of Georgian UCS Block """
  2472.     ret = libxml2mod.xmlUCSIsGeorgian(code)
  2473.     return ret
  2474.  
  2475. def uCSIsGothic(code):
  2476.     """Check whether the character is part of Gothic UCS Block """
  2477.     ret = libxml2mod.xmlUCSIsGothic(code)
  2478.     return ret
  2479.  
  2480. def uCSIsGreek(code):
  2481.     """Check whether the character is part of Greek UCS Block """
  2482.     ret = libxml2mod.xmlUCSIsGreek(code)
  2483.     return ret
  2484.  
  2485. def uCSIsGreekExtended(code):
  2486.     """Check whether the character is part of GreekExtended UCS
  2487.        Block """
  2488.     ret = libxml2mod.xmlUCSIsGreekExtended(code)
  2489.     return ret
  2490.  
  2491. def uCSIsGreekandCoptic(code):
  2492.     """Check whether the character is part of GreekandCoptic UCS
  2493.        Block """
  2494.     ret = libxml2mod.xmlUCSIsGreekandCoptic(code)
  2495.     return ret
  2496.  
  2497. def uCSIsGujarati(code):
  2498.     """Check whether the character is part of Gujarati UCS Block """
  2499.     ret = libxml2mod.xmlUCSIsGujarati(code)
  2500.     return ret
  2501.  
  2502. def uCSIsGurmukhi(code):
  2503.     """Check whether the character is part of Gurmukhi UCS Block """
  2504.     ret = libxml2mod.xmlUCSIsGurmukhi(code)
  2505.     return ret
  2506.  
  2507. def uCSIsHalfwidthandFullwidthForms(code):
  2508.     """Check whether the character is part of
  2509.        HalfwidthandFullwidthForms UCS Block """
  2510.     ret = libxml2mod.xmlUCSIsHalfwidthandFullwidthForms(code)
  2511.     return ret
  2512.  
  2513. def uCSIsHangulCompatibilityJamo(code):
  2514.     """Check whether the character is part of
  2515.        HangulCompatibilityJamo UCS Block """
  2516.     ret = libxml2mod.xmlUCSIsHangulCompatibilityJamo(code)
  2517.     return ret
  2518.  
  2519. def uCSIsHangulJamo(code):
  2520.     """Check whether the character is part of HangulJamo UCS Block """
  2521.     ret = libxml2mod.xmlUCSIsHangulJamo(code)
  2522.     return ret
  2523.  
  2524. def uCSIsHangulSyllables(code):
  2525.     """Check whether the character is part of HangulSyllables UCS
  2526.        Block """
  2527.     ret = libxml2mod.xmlUCSIsHangulSyllables(code)
  2528.     return ret
  2529.  
  2530. def uCSIsHanunoo(code):
  2531.     """Check whether the character is part of Hanunoo UCS Block """
  2532.     ret = libxml2mod.xmlUCSIsHanunoo(code)
  2533.     return ret
  2534.  
  2535. def uCSIsHebrew(code):
  2536.     """Check whether the character is part of Hebrew UCS Block """
  2537.     ret = libxml2mod.xmlUCSIsHebrew(code)
  2538.     return ret
  2539.  
  2540. def uCSIsHighPrivateUseSurrogates(code):
  2541.     """Check whether the character is part of
  2542.        HighPrivateUseSurrogates UCS Block """
  2543.     ret = libxml2mod.xmlUCSIsHighPrivateUseSurrogates(code)
  2544.     return ret
  2545.  
  2546. def uCSIsHighSurrogates(code):
  2547.     """Check whether the character is part of HighSurrogates UCS
  2548.        Block """
  2549.     ret = libxml2mod.xmlUCSIsHighSurrogates(code)
  2550.     return ret
  2551.  
  2552. def uCSIsHiragana(code):
  2553.     """Check whether the character is part of Hiragana UCS Block """
  2554.     ret = libxml2mod.xmlUCSIsHiragana(code)
  2555.     return ret
  2556.  
  2557. def uCSIsIPAExtensions(code):
  2558.     """Check whether the character is part of IPAExtensions UCS
  2559.        Block """
  2560.     ret = libxml2mod.xmlUCSIsIPAExtensions(code)
  2561.     return ret
  2562.  
  2563. def uCSIsIdeographicDescriptionCharacters(code):
  2564.     """Check whether the character is part of
  2565.        IdeographicDescriptionCharacters UCS Block """
  2566.     ret = libxml2mod.xmlUCSIsIdeographicDescriptionCharacters(code)
  2567.     return ret
  2568.  
  2569. def uCSIsKanbun(code):
  2570.     """Check whether the character is part of Kanbun UCS Block """
  2571.     ret = libxml2mod.xmlUCSIsKanbun(code)
  2572.     return ret
  2573.  
  2574. def uCSIsKangxiRadicals(code):
  2575.     """Check whether the character is part of KangxiRadicals UCS
  2576.        Block """
  2577.     ret = libxml2mod.xmlUCSIsKangxiRadicals(code)
  2578.     return ret
  2579.  
  2580. def uCSIsKannada(code):
  2581.     """Check whether the character is part of Kannada UCS Block """
  2582.     ret = libxml2mod.xmlUCSIsKannada(code)
  2583.     return ret
  2584.  
  2585. def uCSIsKatakana(code):
  2586.     """Check whether the character is part of Katakana UCS Block """
  2587.     ret = libxml2mod.xmlUCSIsKatakana(code)
  2588.     return ret
  2589.  
  2590. def uCSIsKatakanaPhoneticExtensions(code):
  2591.     """Check whether the character is part of
  2592.        KatakanaPhoneticExtensions UCS Block """
  2593.     ret = libxml2mod.xmlUCSIsKatakanaPhoneticExtensions(code)
  2594.     return ret
  2595.  
  2596. def uCSIsKhmer(code):
  2597.     """Check whether the character is part of Khmer UCS Block """
  2598.     ret = libxml2mod.xmlUCSIsKhmer(code)
  2599.     return ret
  2600.  
  2601. def uCSIsKhmerSymbols(code):
  2602.     """Check whether the character is part of KhmerSymbols UCS
  2603.        Block """
  2604.     ret = libxml2mod.xmlUCSIsKhmerSymbols(code)
  2605.     return ret
  2606.  
  2607. def uCSIsLao(code):
  2608.     """Check whether the character is part of Lao UCS Block """
  2609.     ret = libxml2mod.xmlUCSIsLao(code)
  2610.     return ret
  2611.  
  2612. def uCSIsLatin1Supplement(code):
  2613.     """Check whether the character is part of Latin-1Supplement
  2614.        UCS Block """
  2615.     ret = libxml2mod.xmlUCSIsLatin1Supplement(code)
  2616.     return ret
  2617.  
  2618. def uCSIsLatinExtendedA(code):
  2619.     """Check whether the character is part of LatinExtended-A UCS
  2620.        Block """
  2621.     ret = libxml2mod.xmlUCSIsLatinExtendedA(code)
  2622.     return ret
  2623.  
  2624. def uCSIsLatinExtendedAdditional(code):
  2625.     """Check whether the character is part of
  2626.        LatinExtendedAdditional UCS Block """
  2627.     ret = libxml2mod.xmlUCSIsLatinExtendedAdditional(code)
  2628.     return ret
  2629.  
  2630. def uCSIsLatinExtendedB(code):
  2631.     """Check whether the character is part of LatinExtended-B UCS
  2632.        Block """
  2633.     ret = libxml2mod.xmlUCSIsLatinExtendedB(code)
  2634.     return ret
  2635.  
  2636. def uCSIsLetterlikeSymbols(code):
  2637.     """Check whether the character is part of LetterlikeSymbols
  2638.        UCS Block """
  2639.     ret = libxml2mod.xmlUCSIsLetterlikeSymbols(code)
  2640.     return ret
  2641.  
  2642. def uCSIsLimbu(code):
  2643.     """Check whether the character is part of Limbu UCS Block """
  2644.     ret = libxml2mod.xmlUCSIsLimbu(code)
  2645.     return ret
  2646.  
  2647. def uCSIsLinearBIdeograms(code):
  2648.     """Check whether the character is part of LinearBIdeograms UCS
  2649.        Block """
  2650.     ret = libxml2mod.xmlUCSIsLinearBIdeograms(code)
  2651.     return ret
  2652.  
  2653. def uCSIsLinearBSyllabary(code):
  2654.     """Check whether the character is part of LinearBSyllabary UCS
  2655.        Block """
  2656.     ret = libxml2mod.xmlUCSIsLinearBSyllabary(code)
  2657.     return ret
  2658.  
  2659. def uCSIsLowSurrogates(code):
  2660.     """Check whether the character is part of LowSurrogates UCS
  2661.        Block """
  2662.     ret = libxml2mod.xmlUCSIsLowSurrogates(code)
  2663.     return ret
  2664.  
  2665. def uCSIsMalayalam(code):
  2666.     """Check whether the character is part of Malayalam UCS Block """
  2667.     ret = libxml2mod.xmlUCSIsMalayalam(code)
  2668.     return ret
  2669.  
  2670. def uCSIsMathematicalAlphanumericSymbols(code):
  2671.     """Check whether the character is part of
  2672.        MathematicalAlphanumericSymbols UCS Block """
  2673.     ret = libxml2mod.xmlUCSIsMathematicalAlphanumericSymbols(code)
  2674.     return ret
  2675.  
  2676. def uCSIsMathematicalOperators(code):
  2677.     """Check whether the character is part of
  2678.        MathematicalOperators UCS Block """
  2679.     ret = libxml2mod.xmlUCSIsMathematicalOperators(code)
  2680.     return ret
  2681.  
  2682. def uCSIsMiscellaneousMathematicalSymbolsA(code):
  2683.     """Check whether the character is part of
  2684.        MiscellaneousMathematicalSymbols-A UCS Block """
  2685.     ret = libxml2mod.xmlUCSIsMiscellaneousMathematicalSymbolsA(code)
  2686.     return ret
  2687.  
  2688. def uCSIsMiscellaneousMathematicalSymbolsB(code):
  2689.     """Check whether the character is part of
  2690.        MiscellaneousMathematicalSymbols-B UCS Block """
  2691.     ret = libxml2mod.xmlUCSIsMiscellaneousMathematicalSymbolsB(code)
  2692.     return ret
  2693.  
  2694. def uCSIsMiscellaneousSymbols(code):
  2695.     """Check whether the character is part of MiscellaneousSymbols
  2696.        UCS Block """
  2697.     ret = libxml2mod.xmlUCSIsMiscellaneousSymbols(code)
  2698.     return ret
  2699.  
  2700. def uCSIsMiscellaneousSymbolsandArrows(code):
  2701.     """Check whether the character is part of
  2702.        MiscellaneousSymbolsandArrows UCS Block """
  2703.     ret = libxml2mod.xmlUCSIsMiscellaneousSymbolsandArrows(code)
  2704.     return ret
  2705.  
  2706. def uCSIsMiscellaneousTechnical(code):
  2707.     """Check whether the character is part of
  2708.        MiscellaneousTechnical UCS Block """
  2709.     ret = libxml2mod.xmlUCSIsMiscellaneousTechnical(code)
  2710.     return ret
  2711.  
  2712. def uCSIsMongolian(code):
  2713.     """Check whether the character is part of Mongolian UCS Block """
  2714.     ret = libxml2mod.xmlUCSIsMongolian(code)
  2715.     return ret
  2716.  
  2717. def uCSIsMusicalSymbols(code):
  2718.     """Check whether the character is part of MusicalSymbols UCS
  2719.        Block """
  2720.     ret = libxml2mod.xmlUCSIsMusicalSymbols(code)
  2721.     return ret
  2722.  
  2723. def uCSIsMyanmar(code):
  2724.     """Check whether the character is part of Myanmar UCS Block """
  2725.     ret = libxml2mod.xmlUCSIsMyanmar(code)
  2726.     return ret
  2727.  
  2728. def uCSIsNumberForms(code):
  2729.     """Check whether the character is part of NumberForms UCS Block """
  2730.     ret = libxml2mod.xmlUCSIsNumberForms(code)
  2731.     return ret
  2732.  
  2733. def uCSIsOgham(code):
  2734.     """Check whether the character is part of Ogham UCS Block """
  2735.     ret = libxml2mod.xmlUCSIsOgham(code)
  2736.     return ret
  2737.  
  2738. def uCSIsOldItalic(code):
  2739.     """Check whether the character is part of OldItalic UCS Block """
  2740.     ret = libxml2mod.xmlUCSIsOldItalic(code)
  2741.     return ret
  2742.  
  2743. def uCSIsOpticalCharacterRecognition(code):
  2744.     """Check whether the character is part of
  2745.        OpticalCharacterRecognition UCS Block """
  2746.     ret = libxml2mod.xmlUCSIsOpticalCharacterRecognition(code)
  2747.     return ret
  2748.  
  2749. def uCSIsOriya(code):
  2750.     """Check whether the character is part of Oriya UCS Block """
  2751.     ret = libxml2mod.xmlUCSIsOriya(code)
  2752.     return ret
  2753.  
  2754. def uCSIsOsmanya(code):
  2755.     """Check whether the character is part of Osmanya UCS Block """
  2756.     ret = libxml2mod.xmlUCSIsOsmanya(code)
  2757.     return ret
  2758.  
  2759. def uCSIsPhoneticExtensions(code):
  2760.     """Check whether the character is part of PhoneticExtensions
  2761.        UCS Block """
  2762.     ret = libxml2mod.xmlUCSIsPhoneticExtensions(code)
  2763.     return ret
  2764.  
  2765. def uCSIsPrivateUse(code):
  2766.     """Check whether the character is part of PrivateUse UCS Block """
  2767.     ret = libxml2mod.xmlUCSIsPrivateUse(code)
  2768.     return ret
  2769.  
  2770. def uCSIsPrivateUseArea(code):
  2771.     """Check whether the character is part of PrivateUseArea UCS
  2772.        Block """
  2773.     ret = libxml2mod.xmlUCSIsPrivateUseArea(code)
  2774.     return ret
  2775.  
  2776. def uCSIsRunic(code):
  2777.     """Check whether the character is part of Runic UCS Block """
  2778.     ret = libxml2mod.xmlUCSIsRunic(code)
  2779.     return ret
  2780.  
  2781. def uCSIsShavian(code):
  2782.     """Check whether the character is part of Shavian UCS Block """
  2783.     ret = libxml2mod.xmlUCSIsShavian(code)
  2784.     return ret
  2785.  
  2786. def uCSIsSinhala(code):
  2787.     """Check whether the character is part of Sinhala UCS Block """
  2788.     ret = libxml2mod.xmlUCSIsSinhala(code)
  2789.     return ret
  2790.  
  2791. def uCSIsSmallFormVariants(code):
  2792.     """Check whether the character is part of SmallFormVariants
  2793.        UCS Block """
  2794.     ret = libxml2mod.xmlUCSIsSmallFormVariants(code)
  2795.     return ret
  2796.  
  2797. def uCSIsSpacingModifierLetters(code):
  2798.     """Check whether the character is part of
  2799.        SpacingModifierLetters UCS Block """
  2800.     ret = libxml2mod.xmlUCSIsSpacingModifierLetters(code)
  2801.     return ret
  2802.  
  2803. def uCSIsSpecials(code):
  2804.     """Check whether the character is part of Specials UCS Block """
  2805.     ret = libxml2mod.xmlUCSIsSpecials(code)
  2806.     return ret
  2807.  
  2808. def uCSIsSuperscriptsandSubscripts(code):
  2809.     """Check whether the character is part of
  2810.        SuperscriptsandSubscripts UCS Block """
  2811.     ret = libxml2mod.xmlUCSIsSuperscriptsandSubscripts(code)
  2812.     return ret
  2813.  
  2814. def uCSIsSupplementalArrowsA(code):
  2815.     """Check whether the character is part of SupplementalArrows-A
  2816.        UCS Block """
  2817.     ret = libxml2mod.xmlUCSIsSupplementalArrowsA(code)
  2818.     return ret
  2819.  
  2820. def uCSIsSupplementalArrowsB(code):
  2821.     """Check whether the character is part of SupplementalArrows-B
  2822.        UCS Block """
  2823.     ret = libxml2mod.xmlUCSIsSupplementalArrowsB(code)
  2824.     return ret
  2825.  
  2826. def uCSIsSupplementalMathematicalOperators(code):
  2827.     """Check whether the character is part of
  2828.        SupplementalMathematicalOperators UCS Block """
  2829.     ret = libxml2mod.xmlUCSIsSupplementalMathematicalOperators(code)
  2830.     return ret
  2831.  
  2832. def uCSIsSupplementaryPrivateUseAreaA(code):
  2833.     """Check whether the character is part of
  2834.        SupplementaryPrivateUseArea-A UCS Block """
  2835.     ret = libxml2mod.xmlUCSIsSupplementaryPrivateUseAreaA(code)
  2836.     return ret
  2837.  
  2838. def uCSIsSupplementaryPrivateUseAreaB(code):
  2839.     """Check whether the character is part of
  2840.        SupplementaryPrivateUseArea-B UCS Block """
  2841.     ret = libxml2mod.xmlUCSIsSupplementaryPrivateUseAreaB(code)
  2842.     return ret
  2843.  
  2844. def uCSIsSyriac(code):
  2845.     """Check whether the character is part of Syriac UCS Block """
  2846.     ret = libxml2mod.xmlUCSIsSyriac(code)
  2847.     return ret
  2848.  
  2849. def uCSIsTagalog(code):
  2850.     """Check whether the character is part of Tagalog UCS Block """
  2851.     ret = libxml2mod.xmlUCSIsTagalog(code)
  2852.     return ret
  2853.  
  2854. def uCSIsTagbanwa(code):
  2855.     """Check whether the character is part of Tagbanwa UCS Block """
  2856.     ret = libxml2mod.xmlUCSIsTagbanwa(code)
  2857.     return ret
  2858.  
  2859. def uCSIsTags(code):
  2860.     """Check whether the character is part of Tags UCS Block """
  2861.     ret = libxml2mod.xmlUCSIsTags(code)
  2862.     return ret
  2863.  
  2864. def uCSIsTaiLe(code):
  2865.     """Check whether the character is part of TaiLe UCS Block """
  2866.     ret = libxml2mod.xmlUCSIsTaiLe(code)
  2867.     return ret
  2868.  
  2869. def uCSIsTaiXuanJingSymbols(code):
  2870.     """Check whether the character is part of TaiXuanJingSymbols
  2871.        UCS Block """
  2872.     ret = libxml2mod.xmlUCSIsTaiXuanJingSymbols(code)
  2873.     return ret
  2874.  
  2875. def uCSIsTamil(code):
  2876.     """Check whether the character is part of Tamil UCS Block """
  2877.     ret = libxml2mod.xmlUCSIsTamil(code)
  2878.     return ret
  2879.  
  2880. def uCSIsTelugu(code):
  2881.     """Check whether the character is part of Telugu UCS Block """
  2882.     ret = libxml2mod.xmlUCSIsTelugu(code)
  2883.     return ret
  2884.  
  2885. def uCSIsThaana(code):
  2886.     """Check whether the character is part of Thaana UCS Block """
  2887.     ret = libxml2mod.xmlUCSIsThaana(code)
  2888.     return ret
  2889.  
  2890. def uCSIsThai(code):
  2891.     """Check whether the character is part of Thai UCS Block """
  2892.     ret = libxml2mod.xmlUCSIsThai(code)
  2893.     return ret
  2894.  
  2895. def uCSIsTibetan(code):
  2896.     """Check whether the character is part of Tibetan UCS Block """
  2897.     ret = libxml2mod.xmlUCSIsTibetan(code)
  2898.     return ret
  2899.  
  2900. def uCSIsUgaritic(code):
  2901.     """Check whether the character is part of Ugaritic UCS Block """
  2902.     ret = libxml2mod.xmlUCSIsUgaritic(code)
  2903.     return ret
  2904.  
  2905. def uCSIsUnifiedCanadianAboriginalSyllabics(code):
  2906.     """Check whether the character is part of
  2907.        UnifiedCanadianAboriginalSyllabics UCS Block """
  2908.     ret = libxml2mod.xmlUCSIsUnifiedCanadianAboriginalSyllabics(code)
  2909.     return ret
  2910.  
  2911. def uCSIsVariationSelectors(code):
  2912.     """Check whether the character is part of VariationSelectors
  2913.        UCS Block """
  2914.     ret = libxml2mod.xmlUCSIsVariationSelectors(code)
  2915.     return ret
  2916.  
  2917. def uCSIsVariationSelectorsSupplement(code):
  2918.     """Check whether the character is part of
  2919.        VariationSelectorsSupplement UCS Block """
  2920.     ret = libxml2mod.xmlUCSIsVariationSelectorsSupplement(code)
  2921.     return ret
  2922.  
  2923. def uCSIsYiRadicals(code):
  2924.     """Check whether the character is part of YiRadicals UCS Block """
  2925.     ret = libxml2mod.xmlUCSIsYiRadicals(code)
  2926.     return ret
  2927.  
  2928. def uCSIsYiSyllables(code):
  2929.     """Check whether the character is part of YiSyllables UCS Block """
  2930.     ret = libxml2mod.xmlUCSIsYiSyllables(code)
  2931.     return ret
  2932.  
  2933. def uCSIsYijingHexagramSymbols(code):
  2934.     """Check whether the character is part of
  2935.        YijingHexagramSymbols UCS Block """
  2936.     ret = libxml2mod.xmlUCSIsYijingHexagramSymbols(code)
  2937.     return ret
  2938.  
  2939. #
  2940. # Functions from module xmlversion
  2941. #
  2942.  
  2943. def checkVersion(version):
  2944.     """check the compiled lib version against the include one.
  2945.        This can warn or immediately kill the application """
  2946.     libxml2mod.xmlCheckVersion(version)
  2947.  
  2948. #
  2949. # Functions from module xpathInternals
  2950. #
  2951.  
  2952. def valuePop(ctxt):
  2953.     """Pops the top XPath object from the value stack """
  2954.     if ctxt is None: ctxt__o = None
  2955.     else: ctxt__o = ctxt._o
  2956.     ret = libxml2mod.valuePop(ctxt__o)
  2957.     return ret
  2958.  
  2959. class xmlNode(xmlCore):
  2960.     def __init__(self, _obj=None):
  2961.         if type(_obj).__name__ != 'PyCObject':
  2962.             raise TypeError, 'xmlNode needs a PyCObject argument'
  2963.         self._o = _obj
  2964.         xmlCore.__init__(self, _obj=_obj)
  2965.  
  2966.     def __repr__(self):
  2967.         return "<xmlNode (%s) object at 0x%x>" % (self.name, long(pos_id (self)))
  2968.  
  2969.     # accessors for xmlNode
  2970.     def ns(self):
  2971.         """Get the namespace of a node """
  2972.         ret = libxml2mod.xmlNodeGetNs(self._o)
  2973.         if ret is None:return None
  2974.         __tmp = xmlNs(_obj=ret)
  2975.         return __tmp
  2976.  
  2977.     def nsDefs(self):
  2978.         """Get the namespace of a node """
  2979.         ret = libxml2mod.xmlNodeGetNsDefs(self._o)
  2980.         if ret is None:return None
  2981.         __tmp = xmlNs(_obj=ret)
  2982.         return __tmp
  2983.  
  2984.     #
  2985.     # xmlNode functions from module debugXML
  2986.     #
  2987.  
  2988.     def debugDumpNode(self, output, depth):
  2989.         """Dumps debug information for the element node, it is
  2990.            recursive """
  2991.         libxml2mod.xmlDebugDumpNode(output, self._o, depth)
  2992.  
  2993.     def debugDumpNodeList(self, output, depth):
  2994.         """Dumps debug information for the list of element node, it is
  2995.            recursive """
  2996.         libxml2mod.xmlDebugDumpNodeList(output, self._o, depth)
  2997.  
  2998.     def debugDumpOneNode(self, output, depth):
  2999.         """Dumps debug information for the element node, it is not
  3000.            recursive """
  3001.         libxml2mod.xmlDebugDumpOneNode(output, self._o, depth)
  3002.  
  3003.     def lsCountNode(self):
  3004.         """Count the children of @node. """
  3005.         ret = libxml2mod.xmlLsCountNode(self._o)
  3006.         return ret
  3007.  
  3008.     def lsOneNode(self, output):
  3009.         """Dump to @output the type and name of @node. """
  3010.         libxml2mod.xmlLsOneNode(output, self._o)
  3011.  
  3012.     def shellPrintNode(self):
  3013.         """Print node to the output FILE """
  3014.         libxml2mod.xmlShellPrintNode(self._o)
  3015.  
  3016.     #
  3017.     # xmlNode functions from module tree
  3018.     #
  3019.  
  3020.     def addChild(self, cur):
  3021.         """Add a new node to @parent, at the end of the child (or
  3022.           property) list merging adjacent TEXT nodes (in which case
  3023.           @cur is freed) If the new node is ATTRIBUTE, it is added
  3024.           into properties instead of children. If there is an
  3025.            attribute with equal name, it is first destroyed. """
  3026.         if cur is None: cur__o = None
  3027.         else: cur__o = cur._o
  3028.         ret = libxml2mod.xmlAddChild(self._o, cur__o)
  3029.         if ret is None:raise treeError('xmlAddChild() failed')
  3030.         __tmp = xmlNode(_obj=ret)
  3031.         return __tmp
  3032.  
  3033.     def addChildList(self, cur):
  3034.         """Add a list of node at the end of the child list of the
  3035.            parent merging adjacent TEXT nodes (@cur may be freed) """
  3036.         if cur is None: cur__o = None
  3037.         else: cur__o = cur._o
  3038.         ret = libxml2mod.xmlAddChildList(self._o, cur__o)
  3039.         if ret is None:raise treeError('xmlAddChildList() failed')
  3040.         __tmp = xmlNode(_obj=ret)
  3041.         return __tmp
  3042.  
  3043.     def addContent(self, content):
  3044.         """Append the extra substring to the node content. NOTE: In
  3045.           contrast to xmlNodeSetContent(), @content is supposed to be
  3046.           raw text, so unescaped XML special chars are allowed,
  3047.            entity references are not supported. """
  3048.         libxml2mod.xmlNodeAddContent(self._o, content)
  3049.  
  3050.     def addContentLen(self, content, len):
  3051.         """Append the extra substring to the node content. NOTE: In
  3052.           contrast to xmlNodeSetContentLen(), @content is supposed to
  3053.           be raw text, so unescaped XML special chars are allowed,
  3054.            entity references are not supported. """
  3055.         libxml2mod.xmlNodeAddContentLen(self._o, content, len)
  3056.  
  3057.     def addNextSibling(self, elem):
  3058.         """Add a new node @elem as the next sibling of @cur If the new
  3059.           node was already inserted in a document it is first
  3060.           unlinked from its existing context. As a result of text
  3061.           merging @elem may be freed. If the new node is ATTRIBUTE,
  3062.           it is added into properties instead of children. If there
  3063.            is an attribute with equal name, it is first destroyed. """
  3064.         if elem is None: elem__o = None
  3065.         else: elem__o = elem._o
  3066.         ret = libxml2mod.xmlAddNextSibling(self._o, elem__o)
  3067.         if ret is None:raise treeError('xmlAddNextSibling() failed')
  3068.         __tmp = xmlNode(_obj=ret)
  3069.         return __tmp
  3070.  
  3071.     def addPrevSibling(self, elem):
  3072.         """Add a new node @elem as the previous sibling of @cur
  3073.           merging adjacent TEXT nodes (@elem may be freed) If the new
  3074.           node was already inserted in a document it is first
  3075.           unlinked from its existing context. If the new node is
  3076.           ATTRIBUTE, it is added into properties instead of children.
  3077.           If there is an attribute with equal name, it is first
  3078.            destroyed. """
  3079.         if elem is None: elem__o = None
  3080.         else: elem__o = elem._o
  3081.         ret = libxml2mod.xmlAddPrevSibling(self._o, elem__o)
  3082.         if ret is None:raise treeError('xmlAddPrevSibling() failed')
  3083.         __tmp = xmlNode(_obj=ret)
  3084.         return __tmp
  3085.  
  3086.     def addSibling(self, elem):
  3087.         """Add a new element @elem to the list of siblings of @cur
  3088.           merging adjacent TEXT nodes (@elem may be freed) If the new
  3089.           element was already inserted in a document it is first
  3090.            unlinked from its existing context. """
  3091.         if elem is None: elem__o = None
  3092.         else: elem__o = elem._o
  3093.         ret = libxml2mod.xmlAddSibling(self._o, elem__o)
  3094.         if ret is None:raise treeError('xmlAddSibling() failed')
  3095.         __tmp = xmlNode(_obj=ret)
  3096.         return __tmp
  3097.  
  3098.     def copyNode(self, extended):
  3099.         """Do a copy of the node. """
  3100.         ret = libxml2mod.xmlCopyNode(self._o, extended)
  3101.         if ret is None:raise treeError('xmlCopyNode() failed')
  3102.         __tmp = xmlNode(_obj=ret)
  3103.         return __tmp
  3104.  
  3105.     def copyNodeList(self):
  3106.         """Do a recursive copy of the node list. Use
  3107.           xmlDocCopyNodeList() if possible to ensure string interning. """
  3108.         ret = libxml2mod.xmlCopyNodeList(self._o)
  3109.         if ret is None:raise treeError('xmlCopyNodeList() failed')
  3110.         __tmp = xmlNode(_obj=ret)
  3111.         return __tmp
  3112.  
  3113.     def copyProp(self, cur):
  3114.         """Do a copy of the attribute. """
  3115.         if cur is None: cur__o = None
  3116.         else: cur__o = cur._o
  3117.         ret = libxml2mod.xmlCopyProp(self._o, cur__o)
  3118.         if ret is None:raise treeError('xmlCopyProp() failed')
  3119.         __tmp = xmlAttr(_obj=ret)
  3120.         return __tmp
  3121.  
  3122.     def copyPropList(self, cur):
  3123.         """Do a copy of an attribute list. """
  3124.         if cur is None: cur__o = None
  3125.         else: cur__o = cur._o
  3126.         ret = libxml2mod.xmlCopyPropList(self._o, cur__o)
  3127.         if ret is None:raise treeError('xmlCopyPropList() failed')
  3128.         __tmp = xmlAttr(_obj=ret)
  3129.         return __tmp
  3130.  
  3131.     def docCopyNode(self, doc, extended):
  3132.         """Do a copy of the node to a given document. """
  3133.         if doc is None: doc__o = None
  3134.         else: doc__o = doc._o
  3135.         ret = libxml2mod.xmlDocCopyNode(self._o, doc__o, extended)
  3136.         if ret is None:raise treeError('xmlDocCopyNode() failed')
  3137.         __tmp = xmlNode(_obj=ret)
  3138.         return __tmp
  3139.  
  3140.     def docCopyNodeList(self, doc):
  3141.         """Do a recursive copy of the node list. """
  3142.         if doc is None: doc__o = None
  3143.         else: doc__o = doc._o
  3144.         ret = libxml2mod.xmlDocCopyNodeList(doc__o, self._o)
  3145.         if ret is None:raise treeError('xmlDocCopyNodeList() failed')
  3146.         __tmp = xmlNode(_obj=ret)
  3147.         return __tmp
  3148.  
  3149.     def docSetRootElement(self, doc):
  3150.         """Set the root element of the document (doc->children is a
  3151.            list containing possibly comments, PIs, etc ...). """
  3152.         if doc is None: doc__o = None
  3153.         else: doc__o = doc._o
  3154.         ret = libxml2mod.xmlDocSetRootElement(doc__o, self._o)
  3155.         if ret is None:return None
  3156.         __tmp = xmlNode(_obj=ret)
  3157.         return __tmp
  3158.  
  3159.     def firstElementChild(self):
  3160.         """Finds the first child node of that element which is a
  3161.           Element node Note the handling of entities references is
  3162.           different than in the W3C DOM element traversal spec since
  3163.           we don't have back reference from entities content to
  3164.            entities references. """
  3165.         ret = libxml2mod.xmlFirstElementChild(self._o)
  3166.         if ret is None:return None
  3167.         __tmp = xmlNode(_obj=ret)
  3168.         return __tmp
  3169.  
  3170.     def freeNode(self):
  3171.         """Free a node, this is a recursive behaviour, all the
  3172.           children are freed too. This doesn't unlink the child from
  3173.            the list, use xmlUnlinkNode() first. """
  3174.         libxml2mod.xmlFreeNode(self._o)
  3175.  
  3176.     def freeNodeList(self):
  3177.         """Free a node and all its siblings, this is a recursive
  3178.            behaviour, all the children are freed too. """
  3179.         libxml2mod.xmlFreeNodeList(self._o)
  3180.  
  3181.     def getBase(self, doc):
  3182.         """Searches for the BASE URL. The code should work on both XML
  3183.           and HTML document even if base mechanisms are completely
  3184.           different. It returns the base as defined in RFC 2396
  3185.           sections 5.1.1. Base URI within Document Content and 5.1.2.
  3186.           Base URI from the Encapsulating Entity However it does not
  3187.            return the document base (5.1.3), use doc->URL in this case """
  3188.         if doc is None: doc__o = None
  3189.         else: doc__o = doc._o
  3190.         ret = libxml2mod.xmlNodeGetBase(doc__o, self._o)
  3191.         return ret
  3192.  
  3193.     def getContent(self):
  3194.         """Read the value of a node, this can be either the text
  3195.           carried directly by this node if it's a TEXT node or the
  3196.           aggregate string of the values carried by this node child's
  3197.            (TEXT and ENTITY_REF). Entity references are substituted. """
  3198.         ret = libxml2mod.xmlNodeGetContent(self._o)
  3199.         return ret
  3200.  
  3201.     def getLang(self):
  3202.         """Searches the language of a node, i.e. the values of the
  3203.           xml:lang attribute or the one carried by the nearest
  3204.            ancestor. """
  3205.         ret = libxml2mod.xmlNodeGetLang(self._o)
  3206.         return ret
  3207.  
  3208.     def getSpacePreserve(self):
  3209.         """Searches the space preserving behaviour of a node, i.e. the
  3210.           values of the xml:space attribute or the one carried by the
  3211.            nearest ancestor. """
  3212.         ret = libxml2mod.xmlNodeGetSpacePreserve(self._o)
  3213.         return ret
  3214.  
  3215.     def hasNsProp(self, name, nameSpace):
  3216.         """Search for an attribute associated to a node This attribute
  3217.           has to be anchored in the namespace specified. This does
  3218.           the entity substitution. This function looks in DTD
  3219.           attribute declaration for #FIXED or default declaration
  3220.           values unless DTD use has been turned off. Note that a
  3221.            namespace of None indicates to use the default namespace. """
  3222.         ret = libxml2mod.xmlHasNsProp(self._o, name, nameSpace)
  3223.         if ret is None:return None
  3224.         __tmp = xmlAttr(_obj=ret)
  3225.         return __tmp
  3226.  
  3227.     def hasProp(self, name):
  3228.         """Search an attribute associated to a node This function also
  3229.           looks in DTD attribute declaration for #FIXED or default
  3230.            declaration values unless DTD use has been turned off. """
  3231.         ret = libxml2mod.xmlHasProp(self._o, name)
  3232.         if ret is None:return None
  3233.         __tmp = xmlAttr(_obj=ret)
  3234.         return __tmp
  3235.  
  3236.     def isBlankNode(self):
  3237.         """Checks whether this node is an empty or whitespace only
  3238.            (and possibly ignorable) text-node. """
  3239.         ret = libxml2mod.xmlIsBlankNode(self._o)
  3240.         return ret
  3241.  
  3242.     def isText(self):
  3243.         """Is this node a Text node ? """
  3244.         ret = libxml2mod.xmlNodeIsText(self._o)
  3245.         return ret
  3246.  
  3247.     def lastChild(self):
  3248.         """Search the last child of a node. """
  3249.         ret = libxml2mod.xmlGetLastChild(self._o)
  3250.         if ret is None:raise treeError('xmlGetLastChild() failed')
  3251.         __tmp = xmlNode(_obj=ret)
  3252.         return __tmp
  3253.  
  3254.     def lastElementChild(self):
  3255.         """Finds the last child node of that element which is a
  3256.           Element node Note the handling of entities references is
  3257.           different than in the W3C DOM element traversal spec since
  3258.           we don't have back reference from entities content to
  3259.            entities references. """
  3260.         ret = libxml2mod.xmlLastElementChild(self._o)
  3261.         if ret is None:return None
  3262.         __tmp = xmlNode(_obj=ret)
  3263.         return __tmp
  3264.  
  3265.     def lineNo(self):
  3266.         """Get line number of @node. This requires activation of this
  3267.           option before invoking the parser by calling
  3268.            xmlLineNumbersDefault(1) """
  3269.         ret = libxml2mod.xmlGetLineNo(self._o)
  3270.         return ret
  3271.  
  3272.     def listGetRawString(self, doc, inLine):
  3273.         """Builds the string equivalent to the text contained in the
  3274.           Node list made of TEXTs and ENTITY_REFs, contrary to
  3275.           xmlNodeListGetString() this function doesn't do any
  3276.            character encoding handling. """
  3277.         if doc is None: doc__o = None
  3278.         else: doc__o = doc._o
  3279.         ret = libxml2mod.xmlNodeListGetRawString(doc__o, self._o, inLine)
  3280.         return ret
  3281.  
  3282.     def listGetString(self, doc, inLine):
  3283.         """Build the string equivalent to the text contained in the
  3284.            Node list made of TEXTs and ENTITY_REFs """
  3285.         if doc is None: doc__o = None
  3286.         else: doc__o = doc._o
  3287.         ret = libxml2mod.xmlNodeListGetString(doc__o, self._o, inLine)
  3288.         return ret
  3289.  
  3290.     def newChild(self, ns, name, content):
  3291.         """Creation of a new child element, added at the end of
  3292.           @parent children list. @ns and @content parameters are
  3293.           optional (None). If @ns is None, the newly created element
  3294.           inherits the namespace of @parent. If @content is non None,
  3295.           a child list containing the TEXTs and ENTITY_REFs node will
  3296.           be created. NOTE: @content is supposed to be a piece of XML
  3297.           CDATA, so it allows entity references. XML special chars
  3298.           must be escaped first by using
  3299.           xmlEncodeEntitiesReentrant(), or xmlNewTextChild() should
  3300.            be used. """
  3301.         if ns is None: ns__o = None
  3302.         else: ns__o = ns._o
  3303.         ret = libxml2mod.xmlNewChild(self._o, ns__o, name, content)
  3304.         if ret is None:raise treeError('xmlNewChild() failed')
  3305.         __tmp = xmlNode(_obj=ret)
  3306.         return __tmp
  3307.  
  3308.     def newNs(self, href, prefix):
  3309.         """Creation of a new Namespace. This function will refuse to
  3310.           create a namespace with a similar prefix than an existing
  3311.           one present on this node. We use href==None in the case of
  3312.            an element creation where the namespace was not defined. """
  3313.         ret = libxml2mod.xmlNewNs(self._o, href, prefix)
  3314.         if ret is None:raise treeError('xmlNewNs() failed')
  3315.         __tmp = xmlNs(_obj=ret)
  3316.         return __tmp
  3317.  
  3318.     def newNsProp(self, ns, name, value):
  3319.         """Create a new property tagged with a namespace and carried
  3320.            by a node. """
  3321.         if ns is None: ns__o = None
  3322.         else: ns__o = ns._o
  3323.         ret = libxml2mod.xmlNewNsProp(self._o, ns__o, name, value)
  3324.         if ret is None:raise treeError('xmlNewNsProp() failed')
  3325.         __tmp = xmlAttr(_obj=ret)
  3326.         return __tmp
  3327.  
  3328.     def newNsPropEatName(self, ns, name, value):
  3329.         """Create a new property tagged with a namespace and carried
  3330.            by a node. """
  3331.         if ns is None: ns__o = None
  3332.         else: ns__o = ns._o
  3333.         ret = libxml2mod.xmlNewNsPropEatName(self._o, ns__o, name, value)
  3334.         if ret is None:raise treeError('xmlNewNsPropEatName() failed')
  3335.         __tmp = xmlAttr(_obj=ret)
  3336.         return __tmp
  3337.  
  3338.     def newProp(self, name, value):
  3339.         """Create a new property carried by a node. """
  3340.         ret = libxml2mod.xmlNewProp(self._o, name, value)
  3341.         if ret is None:raise treeError('xmlNewProp() failed')
  3342.         __tmp = xmlAttr(_obj=ret)
  3343.         return __tmp
  3344.  
  3345.     def newTextChild(self, ns, name, content):
  3346.         """Creation of a new child element, added at the end of
  3347.           @parent children list. @ns and @content parameters are
  3348.           optional (None). If @ns is None, the newly created element
  3349.           inherits the namespace of @parent. If @content is non None,
  3350.           a child TEXT node will be created containing the string
  3351.           @content. NOTE: Use xmlNewChild() if @content will contain
  3352.           entities that need to be preserved. Use this function,
  3353.           xmlNewTextChild(), if you need to ensure that reserved XML
  3354.           chars that might appear in @content, such as the ampersand,
  3355.           greater-than or less-than signs, are automatically replaced
  3356.            by their XML escaped entity representations. """
  3357.         if ns is None: ns__o = None
  3358.         else: ns__o = ns._o
  3359.         ret = libxml2mod.xmlNewTextChild(self._o, ns__o, name, content)
  3360.         if ret is None:raise treeError('xmlNewTextChild() failed')
  3361.         __tmp = xmlNode(_obj=ret)
  3362.         return __tmp
  3363.  
  3364.     def nextElementSibling(self):
  3365.         """Finds the first closest next sibling of the node which is
  3366.           an element node. Note the handling of entities references
  3367.           is different than in the W3C DOM element traversal spec
  3368.           since we don't have back reference from entities content to
  3369.            entities references. """
  3370.         ret = libxml2mod.xmlNextElementSibling(self._o)
  3371.         if ret is None:return None
  3372.         __tmp = xmlNode(_obj=ret)
  3373.         return __tmp
  3374.  
  3375.     def noNsProp(self, name):
  3376.         """Search and get the value of an attribute associated to a
  3377.           node This does the entity substitution. This function looks
  3378.           in DTD attribute declaration for #FIXED or default
  3379.           declaration values unless DTD use has been turned off. This
  3380.           function is similar to xmlGetProp except it will accept
  3381.            only an attribute in no namespace. """
  3382.         ret = libxml2mod.xmlGetNoNsProp(self._o, name)
  3383.         return ret
  3384.  
  3385.     def nodePath(self):
  3386.         """Build a structure based Path for the given node """
  3387.         ret = libxml2mod.xmlGetNodePath(self._o)
  3388.         return ret
  3389.  
  3390.     def nsProp(self, name, nameSpace):
  3391.         """Search and get the value of an attribute associated to a
  3392.           node This attribute has to be anchored in the namespace
  3393.           specified. This does the entity substitution. This function
  3394.           looks in DTD attribute declaration for #FIXED or default
  3395.            declaration values unless DTD use has been turned off. """
  3396.         ret = libxml2mod.xmlGetNsProp(self._o, name, nameSpace)
  3397.         return ret
  3398.  
  3399.     def previousElementSibling(self):
  3400.         """Finds the first closest previous sibling of the node which
  3401.           is an element node. Note the handling of entities
  3402.           references is different than in the W3C DOM element
  3403.           traversal spec since we don't have back reference from
  3404.            entities content to entities references. """
  3405.         ret = libxml2mod.xmlPreviousElementSibling(self._o)
  3406.         if ret is None:return None
  3407.         __tmp = xmlNode(_obj=ret)
  3408.         return __tmp
  3409.  
  3410.     def prop(self, name):
  3411.         """Search and get the value of an attribute associated to a
  3412.           node This does the entity substitution. This function looks
  3413.           in DTD attribute declaration for #FIXED or default
  3414.           declaration values unless DTD use has been turned off.
  3415.           NOTE: this function acts independently of namespaces
  3416.           associated to the attribute. Use xmlGetNsProp() or
  3417.            xmlGetNoNsProp() for namespace aware processing. """
  3418.         ret = libxml2mod.xmlGetProp(self._o, name)
  3419.         return ret
  3420.  
  3421.     def reconciliateNs(self, doc):
  3422.         """This function checks that all the namespaces declared
  3423.           within the given tree are properly declared. This is needed
  3424.           for example after Copy or Cut and then paste operations.
  3425.           The subtree may still hold pointers to namespace
  3426.           declarations outside the subtree or invalid/masked. As much
  3427.           as possible the function try to reuse the existing
  3428.           namespaces found in the new environment. If not possible
  3429.           the new namespaces are redeclared on @tree at the top of
  3430.            the given subtree. """
  3431.         if doc is None: doc__o = None
  3432.         else: doc__o = doc._o
  3433.         ret = libxml2mod.xmlReconciliateNs(doc__o, self._o)
  3434.         return ret
  3435.  
  3436.     def replaceNode(self, cur):
  3437.         """Unlink the old node from its current context, prune the new
  3438.           one at the same place. If @cur was already inserted in a
  3439.            document it is first unlinked from its existing context. """
  3440.         if cur is None: cur__o = None
  3441.         else: cur__o = cur._o
  3442.         ret = libxml2mod.xmlReplaceNode(self._o, cur__o)
  3443.         if ret is None:raise treeError('xmlReplaceNode() failed')
  3444.         __tmp = xmlNode(_obj=ret)
  3445.         return __tmp
  3446.  
  3447.     def searchNs(self, doc, nameSpace):
  3448.         """Search a Ns registered under a given name space for a
  3449.           document. recurse on the parents until it finds the defined
  3450.           namespace or return None otherwise. @nameSpace can be None,
  3451.           this is a search for the default namespace. We don't allow
  3452.           to cross entities boundaries. If you don't declare the
  3453.           namespace within those you will be in troubles !!! A
  3454.            warning is generated to cover this case. """
  3455.         if doc is None: doc__o = None
  3456.         else: doc__o = doc._o
  3457.         ret = libxml2mod.xmlSearchNs(doc__o, self._o, nameSpace)
  3458.         if ret is None:raise treeError('xmlSearchNs() failed')
  3459.         __tmp = xmlNs(_obj=ret)
  3460.         return __tmp
  3461.  
  3462.     def searchNsByHref(self, doc, href):
  3463.         """Search a Ns aliasing a given URI. Recurse on the parents
  3464.           until it finds the defined namespace or return None
  3465.            otherwise. """
  3466.         if doc is None: doc__o = None
  3467.         else: doc__o = doc._o
  3468.         ret = libxml2mod.xmlSearchNsByHref(doc__o, self._o, href)
  3469.         if ret is None:raise treeError('xmlSearchNsByHref() failed')
  3470.         __tmp = xmlNs(_obj=ret)
  3471.         return __tmp
  3472.  
  3473.     def setBase(self, uri):
  3474.         """Set (or reset) the base URI of a node, i.e. the value of
  3475.            the xml:base attribute. """
  3476.         libxml2mod.xmlNodeSetBase(self._o, uri)
  3477.  
  3478.     def setContent(self, content):
  3479.         """Replace the content of a node. NOTE: @content is supposed
  3480.           to be a piece of XML CDATA, so it allows entity references,
  3481.           but XML special chars need to be escaped first by using
  3482.            xmlEncodeEntitiesReentrant() resp. xmlEncodeSpecialChars(). """
  3483.         libxml2mod.xmlNodeSetContent(self._o, content)
  3484.  
  3485.     def setContentLen(self, content, len):
  3486.         """Replace the content of a node. NOTE: @content is supposed
  3487.           to be a piece of XML CDATA, so it allows entity references,
  3488.           but XML special chars need to be escaped first by using
  3489.            xmlEncodeEntitiesReentrant() resp. xmlEncodeSpecialChars(). """
  3490.         libxml2mod.xmlNodeSetContentLen(self._o, content, len)
  3491.  
  3492.     def setLang(self, lang):
  3493.         """Set the language of a node, i.e. the values of the xml:lang
  3494.            attribute. """
  3495.         libxml2mod.xmlNodeSetLang(self._o, lang)
  3496.  
  3497.     def setListDoc(self, doc):
  3498.         """update all nodes in the list to point to the right document """
  3499.         if doc is None: doc__o = None
  3500.         else: doc__o = doc._o
  3501.         libxml2mod.xmlSetListDoc(self._o, doc__o)
  3502.  
  3503.     def setName(self, name):
  3504.         """Set (or reset) the name of a node. """
  3505.         libxml2mod.xmlNodeSetName(self._o, name)
  3506.  
  3507.     def setNs(self, ns):
  3508.         """Associate a namespace to a node, a posteriori. """
  3509.         if ns is None: ns__o = None
  3510.         else: ns__o = ns._o
  3511.         libxml2mod.xmlSetNs(self._o, ns__o)
  3512.  
  3513.     def setNsProp(self, ns, name, value):
  3514.         """Set (or reset) an attribute carried by a node. The ns
  3515.            structure must be in scope, this is not checked """
  3516.         if ns is None: ns__o = None
  3517.         else: ns__o = ns._o
  3518.         ret = libxml2mod.xmlSetNsProp(self._o, ns__o, name, value)
  3519.         if ret is None:raise treeError('xmlSetNsProp() failed')
  3520.         __tmp = xmlAttr(_obj=ret)
  3521.         return __tmp
  3522.  
  3523.     def setProp(self, name, value):
  3524.         """Set (or reset) an attribute carried by a node. If @name has
  3525.           a prefix, then the corresponding namespace-binding will be
  3526.           used, if in scope; it is an error it there's no such
  3527.            ns-binding for the prefix in scope. """
  3528.         ret = libxml2mod.xmlSetProp(self._o, name, value)
  3529.         if ret is None:raise treeError('xmlSetProp() failed')
  3530.         __tmp = xmlAttr(_obj=ret)
  3531.         return __tmp
  3532.  
  3533.     def setSpacePreserve(self, val):
  3534.         """Set (or reset) the space preserving behaviour of a node,
  3535.            i.e. the value of the xml:space attribute. """
  3536.         libxml2mod.xmlNodeSetSpacePreserve(self._o, val)
  3537.  
  3538.     def setTreeDoc(self, doc):
  3539.         """update all nodes under the tree to point to the right
  3540.            document """
  3541.         if doc is None: doc__o = None
  3542.         else: doc__o = doc._o
  3543.         libxml2mod.xmlSetTreeDoc(self._o, doc__o)
  3544.  
  3545.     def textConcat(self, content, len):
  3546.         """Concat the given string at the end of the existing node
  3547.            content """
  3548.         ret = libxml2mod.xmlTextConcat(self._o, content, len)
  3549.         return ret
  3550.  
  3551.     def textMerge(self, second):
  3552.         """Merge two text nodes into one """
  3553.         if second is None: second__o = None
  3554.         else: second__o = second._o
  3555.         ret = libxml2mod.xmlTextMerge(self._o, second__o)
  3556.         if ret is None:raise treeError('xmlTextMerge() failed')
  3557.         __tmp = xmlNode(_obj=ret)
  3558.         return __tmp
  3559.  
  3560.     def unlinkNode(self):
  3561.         """Unlink a node from it's current context, the node is not
  3562.            freed """
  3563.         libxml2mod.xmlUnlinkNode(self._o)
  3564.  
  3565.     def unsetNsProp(self, ns, name):
  3566.         """Remove an attribute carried by a node. """
  3567.         if ns is None: ns__o = None
  3568.         else: ns__o = ns._o
  3569.         ret = libxml2mod.xmlUnsetNsProp(self._o, ns__o, name)
  3570.         return ret
  3571.  
  3572.     def unsetProp(self, name):
  3573.         """Remove an attribute carried by a node. This handles only
  3574.            attributes in no namespace. """
  3575.         ret = libxml2mod.xmlUnsetProp(self._o, name)
  3576.         return ret
  3577.  
  3578.     #
  3579.     # xmlNode functions from module valid
  3580.     #
  3581.  
  3582.     def isID(self, doc, attr):
  3583.         """Determine whether an attribute is of type ID. In case we
  3584.           have DTD(s) then this is done if DTD loading has been
  3585.           requested. In the case of HTML documents parsed with the
  3586.            HTML parser, then ID detection is done systematically. """
  3587.         if doc is None: doc__o = None
  3588.         else: doc__o = doc._o
  3589.         if attr is None: attr__o = None
  3590.         else: attr__o = attr._o
  3591.         ret = libxml2mod.xmlIsID(doc__o, self._o, attr__o)
  3592.         return ret
  3593.  
  3594.     def isRef(self, doc, attr):
  3595.         """Determine whether an attribute is of type Ref. In case we
  3596.           have DTD(s) then this is simple, otherwise we use an
  3597.            heuristic: name Ref (upper or lowercase). """
  3598.         if doc is None: doc__o = None
  3599.         else: doc__o = doc._o
  3600.         if attr is None: attr__o = None
  3601.         else: attr__o = attr._o
  3602.         ret = libxml2mod.xmlIsRef(doc__o, self._o, attr__o)
  3603.         return ret
  3604.  
  3605.     def validNormalizeAttributeValue(self, doc, name, value):
  3606.         """Does the validation related extra step of the normalization
  3607.           of attribute values:  If the declared value is not CDATA,
  3608.           then the XML processor must further process the normalized
  3609.           attribute value by discarding any leading and trailing
  3610.           space (#x20) characters, and by replacing sequences of
  3611.            space (#x20) characters by single space (#x20) character. """
  3612.         if doc is None: doc__o = None
  3613.         else: doc__o = doc._o
  3614.         ret = libxml2mod.xmlValidNormalizeAttributeValue(doc__o, self._o, name, value)
  3615.         return ret
  3616.  
  3617.     #
  3618.     # xmlNode functions from module xinclude
  3619.     #
  3620.  
  3621.     def xincludeProcessTree(self):
  3622.         """Implement the XInclude substitution for the given subtree """
  3623.         ret = libxml2mod.xmlXIncludeProcessTree(self._o)
  3624.         return ret
  3625.  
  3626.     def xincludeProcessTreeFlags(self, flags):
  3627.         """Implement the XInclude substitution for the given subtree """
  3628.         ret = libxml2mod.xmlXIncludeProcessTreeFlags(self._o, flags)
  3629.         return ret
  3630.  
  3631.     #
  3632.     # xmlNode functions from module xmlschemas
  3633.     #
  3634.  
  3635.     def schemaValidateOneElement(self, ctxt):
  3636.         """Validate a branch of a tree, starting with the given @elem. """
  3637.         if ctxt is None: ctxt__o = None
  3638.         else: ctxt__o = ctxt._o
  3639.         ret = libxml2mod.xmlSchemaValidateOneElement(ctxt__o, self._o)
  3640.         return ret
  3641.  
  3642.     #
  3643.     # xmlNode functions from module xpath
  3644.     #
  3645.  
  3646.     def xpathCastNodeToNumber(self):
  3647.         """Converts a node to its number value """
  3648.         ret = libxml2mod.xmlXPathCastNodeToNumber(self._o)
  3649.         return ret
  3650.  
  3651.     def xpathCastNodeToString(self):
  3652.         """Converts a node to its string value. """
  3653.         ret = libxml2mod.xmlXPathCastNodeToString(self._o)
  3654.         return ret
  3655.  
  3656.     def xpathCmpNodes(self, node2):
  3657.         """Compare two nodes w.r.t document order """
  3658.         if node2 is None: node2__o = None
  3659.         else: node2__o = node2._o
  3660.         ret = libxml2mod.xmlXPathCmpNodes(self._o, node2__o)
  3661.         return ret
  3662.  
  3663.     #
  3664.     # xmlNode functions from module xpathInternals
  3665.     #
  3666.  
  3667.     def xpathNewNodeSet(self):
  3668.         """Create a new xmlXPathObjectPtr of type NodeSet and
  3669.            initialize it with the single Node @val """
  3670.         ret = libxml2mod.xmlXPathNewNodeSet(self._o)
  3671.         if ret is None:raise xpathError('xmlXPathNewNodeSet() failed')
  3672.         return xpathObjectRet(ret)
  3673.  
  3674.     def xpathNewValueTree(self):
  3675.         """Create a new xmlXPathObjectPtr of type Value Tree (XSLT)
  3676.            and initialize it with the tree root @val """
  3677.         ret = libxml2mod.xmlXPathNewValueTree(self._o)
  3678.         if ret is None:raise xpathError('xmlXPathNewValueTree() failed')
  3679.         return xpathObjectRet(ret)
  3680.  
  3681.     def xpathNextAncestor(self, ctxt):
  3682.         """Traversal function for the "ancestor" direction the
  3683.           ancestor axis contains the ancestors of the context node;
  3684.           the ancestors of the context node consist of the parent of
  3685.           context node and the parent's parent and so on; the nodes
  3686.           are ordered in reverse document order; thus the parent is
  3687.           the first node on the axis, and the parent's parent is the
  3688.            second node on the axis """
  3689.         if ctxt is None: ctxt__o = None
  3690.         else: ctxt__o = ctxt._o
  3691.         ret = libxml2mod.xmlXPathNextAncestor(ctxt__o, self._o)
  3692.         if ret is None:raise xpathError('xmlXPathNextAncestor() failed')
  3693.         __tmp = xmlNode(_obj=ret)
  3694.         return __tmp
  3695.  
  3696.     def xpathNextAncestorOrSelf(self, ctxt):
  3697.         """Traversal function for the "ancestor-or-self" direction he
  3698.           ancestor-or-self axis contains the context node and
  3699.           ancestors of the context node in reverse document order;
  3700.           thus the context node is the first node on the axis, and
  3701.           the context node's parent the second; parent here is
  3702.            defined the same as with the parent axis. """
  3703.         if ctxt is None: ctxt__o = None
  3704.         else: ctxt__o = ctxt._o
  3705.         ret = libxml2mod.xmlXPathNextAncestorOrSelf(ctxt__o, self._o)
  3706.         if ret is None:raise xpathError('xmlXPathNextAncestorOrSelf() failed')
  3707.         __tmp = xmlNode(_obj=ret)
  3708.         return __tmp
  3709.  
  3710.     def xpathNextAttribute(self, ctxt):
  3711.         """Traversal function for the "attribute" direction TODO:
  3712.            support DTD inherited default attributes """
  3713.         if ctxt is None: ctxt__o = None
  3714.         else: ctxt__o = ctxt._o
  3715.         ret = libxml2mod.xmlXPathNextAttribute(ctxt__o, self._o)
  3716.         if ret is None:raise xpathError('xmlXPathNextAttribute() failed')
  3717.         __tmp = xmlNode(_obj=ret)
  3718.         return __tmp
  3719.  
  3720.     def xpathNextChild(self, ctxt):
  3721.         """Traversal function for the "child" direction The child axis
  3722.           contains the children of the context node in document order. """
  3723.         if ctxt is None: ctxt__o = None
  3724.         else: ctxt__o = ctxt._o
  3725.         ret = libxml2mod.xmlXPathNextChild(ctxt__o, self._o)
  3726.         if ret is None:raise xpathError('xmlXPathNextChild() failed')
  3727.         __tmp = xmlNode(_obj=ret)
  3728.         return __tmp
  3729.  
  3730.     def xpathNextDescendant(self, ctxt):
  3731.         """Traversal function for the "descendant" direction the
  3732.           descendant axis contains the descendants of the context
  3733.           node in document order; a descendant is a child or a child
  3734.            of a child and so on. """
  3735.         if ctxt is None: ctxt__o = None
  3736.         else: ctxt__o = ctxt._o
  3737.         ret = libxml2mod.xmlXPathNextDescendant(ctxt__o, self._o)
  3738.         if ret is None:raise xpathError('xmlXPathNextDescendant() failed')
  3739.         __tmp = xmlNode(_obj=ret)
  3740.         return __tmp
  3741.  
  3742.     def xpathNextDescendantOrSelf(self, ctxt):
  3743.         """Traversal function for the "descendant-or-self" direction
  3744.           the descendant-or-self axis contains the context node and
  3745.           the descendants of the context node in document order; thus
  3746.           the context node is the first node on the axis, and the
  3747.           first child of the context node is the second node on the
  3748.            axis """
  3749.         if ctxt is None: ctxt__o = None
  3750.         else: ctxt__o = ctxt._o
  3751.         ret = libxml2mod.xmlXPathNextDescendantOrSelf(ctxt__o, self._o)
  3752.         if ret is None:raise xpathError('xmlXPathNextDescendantOrSelf() failed')
  3753.         __tmp = xmlNode(_obj=ret)
  3754.         return __tmp
  3755.  
  3756.     def xpathNextFollowing(self, ctxt):
  3757.         """Traversal function for the "following" direction The
  3758.           following axis contains all nodes in the same document as
  3759.           the context node that are after the context node in
  3760.           document order, excluding any descendants and excluding
  3761.           attribute nodes and namespace nodes; the nodes are ordered
  3762.            in document order """
  3763.         if ctxt is None: ctxt__o = None
  3764.         else: ctxt__o = ctxt._o
  3765.         ret = libxml2mod.xmlXPathNextFollowing(ctxt__o, self._o)
  3766.         if ret is None:raise xpathError('xmlXPathNextFollowing() failed')
  3767.         __tmp = xmlNode(_obj=ret)
  3768.         return __tmp
  3769.  
  3770.     def xpathNextFollowingSibling(self, ctxt):
  3771.         """Traversal function for the "following-sibling" direction
  3772.           The following-sibling axis contains the following siblings
  3773.            of the context node in document order. """
  3774.         if ctxt is None: ctxt__o = None
  3775.         else: ctxt__o = ctxt._o
  3776.         ret = libxml2mod.xmlXPathNextFollowingSibling(ctxt__o, self._o)
  3777.         if ret is None:raise xpathError('xmlXPathNextFollowingSibling() failed')
  3778.         __tmp = xmlNode(_obj=ret)
  3779.         return __tmp
  3780.  
  3781.     def xpathNextNamespace(self, ctxt):
  3782.         """Traversal function for the "namespace" direction the
  3783.           namespace axis contains the namespace nodes of the context
  3784.           node; the order of nodes on this axis is
  3785.           implementation-defined; the axis will be empty unless the
  3786.           context node is an element  We keep the XML namespace node
  3787.            at the end of the list. """
  3788.         if ctxt is None: ctxt__o = None
  3789.         else: ctxt__o = ctxt._o
  3790.         ret = libxml2mod.xmlXPathNextNamespace(ctxt__o, self._o)
  3791.         if ret is None:raise xpathError('xmlXPathNextNamespace() failed')
  3792.         __tmp = xmlNode(_obj=ret)
  3793.         return __tmp
  3794.  
  3795.     def xpathNextParent(self, ctxt):
  3796.         """Traversal function for the "parent" direction The parent
  3797.           axis contains the parent of the context node, if there is
  3798.            one. """
  3799.         if ctxt is None: ctxt__o = None
  3800.         else: ctxt__o = ctxt._o
  3801.         ret = libxml2mod.xmlXPathNextParent(ctxt__o, self._o)
  3802.         if ret is None:raise xpathError('xmlXPathNextParent() failed')
  3803.         __tmp = xmlNode(_obj=ret)
  3804.         return __tmp
  3805.  
  3806.     def xpathNextPreceding(self, ctxt):
  3807.         """Traversal function for the "preceding" direction the
  3808.           preceding axis contains all nodes in the same document as
  3809.           the context node that are before the context node in
  3810.           document order, excluding any ancestors and excluding
  3811.           attribute nodes and namespace nodes; the nodes are ordered
  3812.            in reverse document order """
  3813.         if ctxt is None: ctxt__o = None
  3814.         else: ctxt__o = ctxt._o
  3815.         ret = libxml2mod.xmlXPathNextPreceding(ctxt__o, self._o)
  3816.         if ret is None:raise xpathError('xmlXPathNextPreceding() failed')
  3817.         __tmp = xmlNode(_obj=ret)
  3818.         return __tmp
  3819.  
  3820.     def xpathNextPrecedingSibling(self, ctxt):
  3821.         """Traversal function for the "preceding-sibling" direction
  3822.           The preceding-sibling axis contains the preceding siblings
  3823.           of the context node in reverse document order; the first
  3824.           preceding sibling is first on the axis; the sibling
  3825.            preceding that node is the second on the axis and so on. """
  3826.         if ctxt is None: ctxt__o = None
  3827.         else: ctxt__o = ctxt._o
  3828.         ret = libxml2mod.xmlXPathNextPrecedingSibling(ctxt__o, self._o)
  3829.         if ret is None:raise xpathError('xmlXPathNextPrecedingSibling() failed')
  3830.         __tmp = xmlNode(_obj=ret)
  3831.         return __tmp
  3832.  
  3833.     def xpathNextSelf(self, ctxt):
  3834.         """Traversal function for the "self" direction The self axis
  3835.            contains just the context node itself """
  3836.         if ctxt is None: ctxt__o = None
  3837.         else: ctxt__o = ctxt._o
  3838.         ret = libxml2mod.xmlXPathNextSelf(ctxt__o, self._o)
  3839.         if ret is None:raise xpathError('xmlXPathNextSelf() failed')
  3840.         __tmp = xmlNode(_obj=ret)
  3841.         return __tmp
  3842.  
  3843.     #
  3844.     # xmlNode functions from module xpointer
  3845.     #
  3846.  
  3847.     def xpointerNewCollapsedRange(self):
  3848.         """Create a new xmlXPathObjectPtr of type range using a single
  3849.            nodes """
  3850.         ret = libxml2mod.xmlXPtrNewCollapsedRange(self._o)
  3851.         if ret is None:raise treeError('xmlXPtrNewCollapsedRange() failed')
  3852.         return xpathObjectRet(ret)
  3853.  
  3854.     def xpointerNewContext(self, doc, origin):
  3855.         """Create a new XPointer context """
  3856.         if doc is None: doc__o = None
  3857.         else: doc__o = doc._o
  3858.         if origin is None: origin__o = None
  3859.         else: origin__o = origin._o
  3860.         ret = libxml2mod.xmlXPtrNewContext(doc__o, self._o, origin__o)
  3861.         if ret is None:raise treeError('xmlXPtrNewContext() failed')
  3862.         __tmp = xpathContext(_obj=ret)
  3863.         return __tmp
  3864.  
  3865.     def xpointerNewLocationSetNodes(self, end):
  3866.         """Create a new xmlXPathObjectPtr of type LocationSet and
  3867.           initialize it with the single range made of the two nodes
  3868.            @start and @end """
  3869.         if end is None: end__o = None
  3870.         else: end__o = end._o
  3871.         ret = libxml2mod.xmlXPtrNewLocationSetNodes(self._o, end__o)
  3872.         if ret is None:raise treeError('xmlXPtrNewLocationSetNodes() failed')
  3873.         return xpathObjectRet(ret)
  3874.  
  3875.     def xpointerNewRange(self, startindex, end, endindex):
  3876.         """Create a new xmlXPathObjectPtr of type range """
  3877.         if end is None: end__o = None
  3878.         else: end__o = end._o
  3879.         ret = libxml2mod.xmlXPtrNewRange(self._o, startindex, end__o, endindex)
  3880.         if ret is None:raise treeError('xmlXPtrNewRange() failed')
  3881.         return xpathObjectRet(ret)
  3882.  
  3883.     def xpointerNewRangeNodes(self, end):
  3884.         """Create a new xmlXPathObjectPtr of type range using 2 nodes """
  3885.         if end is None: end__o = None
  3886.         else: end__o = end._o
  3887.         ret = libxml2mod.xmlXPtrNewRangeNodes(self._o, end__o)
  3888.         if ret is None:raise treeError('xmlXPtrNewRangeNodes() failed')
  3889.         return xpathObjectRet(ret)
  3890.  
  3891. class xmlDoc(xmlNode):
  3892.     def __init__(self, _obj=None):
  3893.         if type(_obj).__name__ != 'PyCObject':
  3894.             raise TypeError, 'xmlDoc needs a PyCObject argument'
  3895.         self._o = _obj
  3896.         xmlNode.__init__(self, _obj=_obj)
  3897.  
  3898.     def __repr__(self):
  3899.         return "<xmlDoc (%s) object at 0x%x>" % (self.name, long(pos_id (self)))
  3900.  
  3901.     #
  3902.     # xmlDoc functions from module HTMLparser
  3903.     #
  3904.  
  3905.     def htmlAutoCloseTag(self, name, elem):
  3906.         """The HTML DTD allows a tag to implicitly close other tags.
  3907.           The list is kept in htmlStartClose array. This function
  3908.           checks if the element or one of it's children would
  3909.            autoclose the given tag. """
  3910.         ret = libxml2mod.htmlAutoCloseTag(self._o, name, elem)
  3911.         return ret
  3912.  
  3913.     def htmlIsAutoClosed(self, elem):
  3914.         """The HTML DTD allows a tag to implicitly close other tags.
  3915.           The list is kept in htmlStartClose array. This function
  3916.            checks if a tag is autoclosed by one of it's child """
  3917.         ret = libxml2mod.htmlIsAutoClosed(self._o, elem)
  3918.         return ret
  3919.  
  3920.     #
  3921.     # xmlDoc functions from module HTMLtree
  3922.     #
  3923.  
  3924.     def htmlDocContentDumpFormatOutput(self, buf, encoding, format):
  3925.         """Dump an HTML document. """
  3926.         if buf is None: buf__o = None
  3927.         else: buf__o = buf._o
  3928.         libxml2mod.htmlDocContentDumpFormatOutput(buf__o, self._o, encoding, format)
  3929.  
  3930.     def htmlDocContentDumpOutput(self, buf, encoding):
  3931.         """Dump an HTML document. Formating return/spaces are added. """
  3932.         if buf is None: buf__o = None
  3933.         else: buf__o = buf._o
  3934.         libxml2mod.htmlDocContentDumpOutput(buf__o, self._o, encoding)
  3935.  
  3936.     def htmlDocDump(self, f):
  3937.         """Dump an HTML document to an open FILE. """
  3938.         ret = libxml2mod.htmlDocDump(f, self._o)
  3939.         return ret
  3940.  
  3941.     def htmlGetMetaEncoding(self):
  3942.         """Encoding definition lookup in the Meta tags """
  3943.         ret = libxml2mod.htmlGetMetaEncoding(self._o)
  3944.         return ret
  3945.  
  3946.     def htmlNodeDumpFile(self, out, cur):
  3947.         """Dump an HTML node, recursive behaviour,children are printed
  3948.            too, and formatting returns are added. """
  3949.         if cur is None: cur__o = None
  3950.         else: cur__o = cur._o
  3951.         libxml2mod.htmlNodeDumpFile(out, self._o, cur__o)
  3952.  
  3953.     def htmlNodeDumpFileFormat(self, out, cur, encoding, format):
  3954.         """Dump an HTML node, recursive behaviour,children are printed
  3955.           too.  TODO: if encoding == None try to save in the doc
  3956.            encoding """
  3957.         if cur is None: cur__o = None
  3958.         else: cur__o = cur._o
  3959.         ret = libxml2mod.htmlNodeDumpFileFormat(out, self._o, cur__o, encoding, format)
  3960.         return ret
  3961.  
  3962.     def htmlNodeDumpFormatOutput(self, buf, cur, encoding, format):
  3963.         """Dump an HTML node, recursive behaviour,children are printed
  3964.            too. """
  3965.         if buf is None: buf__o = None
  3966.         else: buf__o = buf._o
  3967.         if cur is None: cur__o = None
  3968.         else: cur__o = cur._o
  3969.         libxml2mod.htmlNodeDumpFormatOutput(buf__o, self._o, cur__o, encoding, format)
  3970.  
  3971.     def htmlNodeDumpOutput(self, buf, cur, encoding):
  3972.         """Dump an HTML node, recursive behaviour,children are printed
  3973.            too, and formatting returns/spaces are added. """
  3974.         if buf is None: buf__o = None
  3975.         else: buf__o = buf._o
  3976.         if cur is None: cur__o = None
  3977.         else: cur__o = cur._o
  3978.         libxml2mod.htmlNodeDumpOutput(buf__o, self._o, cur__o, encoding)
  3979.  
  3980.     def htmlSaveFile(self, filename):
  3981.         """Dump an HTML document to a file. If @filename is "-" the
  3982.            stdout file is used. """
  3983.         ret = libxml2mod.htmlSaveFile(filename, self._o)
  3984.         return ret
  3985.  
  3986.     def htmlSaveFileEnc(self, filename, encoding):
  3987.         """Dump an HTML document to a file using a given encoding and
  3988.            formatting returns/spaces are added. """
  3989.         ret = libxml2mod.htmlSaveFileEnc(filename, self._o, encoding)
  3990.         return ret
  3991.  
  3992.     def htmlSaveFileFormat(self, filename, encoding, format):
  3993.         """Dump an HTML document to a file using a given encoding. """
  3994.         ret = libxml2mod.htmlSaveFileFormat(filename, self._o, encoding, format)
  3995.         return ret
  3996.  
  3997.     def htmlSetMetaEncoding(self, encoding):
  3998.         """Sets the current encoding in the Meta tags NOTE: this will
  3999.           not change the document content encoding, just the META
  4000.            flag associated. """
  4001.         ret = libxml2mod.htmlSetMetaEncoding(self._o, encoding)
  4002.         return ret
  4003.  
  4004.     #
  4005.     # xmlDoc functions from module debugXML
  4006.     #
  4007.  
  4008.     def debugCheckDocument(self, output):
  4009.         """Check the document for potential content problems, and
  4010.            output the errors to @output """
  4011.         ret = libxml2mod.xmlDebugCheckDocument(output, self._o)
  4012.         return ret
  4013.  
  4014.     def debugDumpDocument(self, output):
  4015.         """Dumps debug information for the document, it's recursive """
  4016.         libxml2mod.xmlDebugDumpDocument(output, self._o)
  4017.  
  4018.     def debugDumpDocumentHead(self, output):
  4019.         """Dumps debug information cncerning the document, not
  4020.            recursive """
  4021.         libxml2mod.xmlDebugDumpDocumentHead(output, self._o)
  4022.  
  4023.     def debugDumpEntities(self, output):
  4024.         """Dumps debug information for all the entities in use by the
  4025.            document """
  4026.         libxml2mod.xmlDebugDumpEntities(output, self._o)
  4027.  
  4028.     #
  4029.     # xmlDoc functions from module entities
  4030.     #
  4031.  
  4032.     def addDocEntity(self, name, type, ExternalID, SystemID, content):
  4033.         """Register a new entity for this document. """
  4034.         ret = libxml2mod.xmlAddDocEntity(self._o, name, type, ExternalID, SystemID, content)
  4035.         if ret is None:raise treeError('xmlAddDocEntity() failed')
  4036.         __tmp = xmlEntity(_obj=ret)
  4037.         return __tmp
  4038.  
  4039.     def addDtdEntity(self, name, type, ExternalID, SystemID, content):
  4040.         """Register a new entity for this document DTD external subset. """
  4041.         ret = libxml2mod.xmlAddDtdEntity(self._o, name, type, ExternalID, SystemID, content)
  4042.         if ret is None:raise treeError('xmlAddDtdEntity() failed')
  4043.         __tmp = xmlEntity(_obj=ret)
  4044.         return __tmp
  4045.  
  4046.     def docEntity(self, name):
  4047.         """Do an entity lookup in the document entity hash table and """
  4048.         ret = libxml2mod.xmlGetDocEntity(self._o, name)
  4049.         if ret is None:raise treeError('xmlGetDocEntity() failed')
  4050.         __tmp = xmlEntity(_obj=ret)
  4051.         return __tmp
  4052.  
  4053.     def dtdEntity(self, name):
  4054.         """Do an entity lookup in the DTD entity hash table and """
  4055.         ret = libxml2mod.xmlGetDtdEntity(self._o, name)
  4056.         if ret is None:raise treeError('xmlGetDtdEntity() failed')
  4057.         __tmp = xmlEntity(_obj=ret)
  4058.         return __tmp
  4059.  
  4060.     def encodeEntities(self, input):
  4061.         """TODO: remove xmlEncodeEntities, once we are not afraid of
  4062.           breaking binary compatibility  People must migrate their
  4063.           code to xmlEncodeEntitiesReentrant ! This routine will
  4064.            issue a warning when encountered. """
  4065.         ret = libxml2mod.xmlEncodeEntities(self._o, input)
  4066.         return ret
  4067.  
  4068.     def encodeEntitiesReentrant(self, input):
  4069.         """Do a global encoding of a string, replacing the predefined
  4070.           entities and non ASCII values with their entities and
  4071.           CharRef counterparts. Contrary to xmlEncodeEntities, this
  4072.            routine is reentrant, and result must be deallocated. """
  4073.         ret = libxml2mod.xmlEncodeEntitiesReentrant(self._o, input)
  4074.         return ret
  4075.  
  4076.     def encodeSpecialChars(self, input):
  4077.         """Do a global encoding of a string, replacing the predefined
  4078.           entities this routine is reentrant, and result must be
  4079.            deallocated. """
  4080.         ret = libxml2mod.xmlEncodeSpecialChars(self._o, input)
  4081.         return ret
  4082.  
  4083.     def newEntity(self, name, type, ExternalID, SystemID, content):
  4084.         """Create a new entity, this differs from xmlAddDocEntity()
  4085.           that if the document is None or has no internal subset
  4086.           defined, then an unlinked entity structure will be
  4087.           returned, it is then the responsability of the caller to
  4088.           link it to the document later or free it when not needed
  4089.            anymore. """
  4090.         ret = libxml2mod.xmlNewEntity(self._o, name, type, ExternalID, SystemID, content)
  4091.         if ret is None:raise treeError('xmlNewEntity() failed')
  4092.         __tmp = xmlEntity(_obj=ret)
  4093.         return __tmp
  4094.  
  4095.     def parameterEntity(self, name):
  4096.         """Do an entity lookup in the internal and external subsets and """
  4097.         ret = libxml2mod.xmlGetParameterEntity(self._o, name)
  4098.         if ret is None:raise treeError('xmlGetParameterEntity() failed')
  4099.         __tmp = xmlEntity(_obj=ret)
  4100.         return __tmp
  4101.  
  4102.     #
  4103.     # xmlDoc functions from module relaxng
  4104.     #
  4105.  
  4106.     def relaxNGNewDocParserCtxt(self):
  4107.         """Create an XML RelaxNGs parser context for that document.
  4108.           Note: since the process of compiling a RelaxNG schemas
  4109.           modifies the document, the @doc parameter is duplicated
  4110.            internally. """
  4111.         ret = libxml2mod.xmlRelaxNGNewDocParserCtxt(self._o)
  4112.         if ret is None:raise parserError('xmlRelaxNGNewDocParserCtxt() failed')
  4113.         __tmp = relaxNgParserCtxt(_obj=ret)
  4114.         return __tmp
  4115.  
  4116.     def relaxNGValidateDoc(self, ctxt):
  4117.         """Validate a document tree in memory. """
  4118.         if ctxt is None: ctxt__o = None
  4119.         else: ctxt__o = ctxt._o
  4120.         ret = libxml2mod.xmlRelaxNGValidateDoc(ctxt__o, self._o)
  4121.         return ret
  4122.  
  4123.     def relaxNGValidateFullElement(self, ctxt, elem):
  4124.         """Validate a full subtree when
  4125.           xmlRelaxNGValidatePushElement() returned 0 and the content
  4126.            of the node has been expanded. """
  4127.         if ctxt is None: ctxt__o = None
  4128.         else: ctxt__o = ctxt._o
  4129.         if elem is None: elem__o = None
  4130.         else: elem__o = elem._o
  4131.         ret = libxml2mod.xmlRelaxNGValidateFullElement(ctxt__o, self._o, elem__o)
  4132.         return ret
  4133.  
  4134.     def relaxNGValidatePopElement(self, ctxt, elem):
  4135.         """Pop the element end from the RelaxNG validation stack. """
  4136.         if ctxt is None: ctxt__o = None
  4137.         else: ctxt__o = ctxt._o
  4138.         if elem is None: elem__o = None
  4139.         else: elem__o = elem._o
  4140.         ret = libxml2mod.xmlRelaxNGValidatePopElement(ctxt__o, self._o, elem__o)
  4141.         return ret
  4142.  
  4143.     def relaxNGValidatePushElement(self, ctxt, elem):
  4144.         """Push a new element start on the RelaxNG validation stack. """
  4145.         if ctxt is None: ctxt__o = None
  4146.         else: ctxt__o = ctxt._o
  4147.         if elem is None: elem__o = None
  4148.         else: elem__o = elem._o
  4149.         ret = libxml2mod.xmlRelaxNGValidatePushElement(ctxt__o, self._o, elem__o)
  4150.         return ret
  4151.  
  4152.     #
  4153.     # xmlDoc functions from module tree
  4154.     #
  4155.  
  4156.     def copyDoc(self, recursive):
  4157.         """Do a copy of the document info. If recursive, the content
  4158.           tree will be copied too as well as DTD, namespaces and
  4159.            entities. """
  4160.         ret = libxml2mod.xmlCopyDoc(self._o, recursive)
  4161.         if ret is None:raise treeError('xmlCopyDoc() failed')
  4162.         __tmp = xmlDoc(_obj=ret)
  4163.         return __tmp
  4164.  
  4165.     def copyNode(self, node, extended):
  4166.         """Do a copy of the node to a given document. """
  4167.         if node is None: node__o = None
  4168.         else: node__o = node._o
  4169.         ret = libxml2mod.xmlDocCopyNode(node__o, self._o, extended)
  4170.         if ret is None:raise treeError('xmlDocCopyNode() failed')
  4171.         __tmp = xmlNode(_obj=ret)
  4172.         return __tmp
  4173.  
  4174.     def copyNodeList(self, node):
  4175.         """Do a recursive copy of the node list. """
  4176.         if node is None: node__o = None
  4177.         else: node__o = node._o
  4178.         ret = libxml2mod.xmlDocCopyNodeList(self._o, node__o)
  4179.         if ret is None:raise treeError('xmlDocCopyNodeList() failed')
  4180.         __tmp = xmlNode(_obj=ret)
  4181.         return __tmp
  4182.  
  4183.     def createIntSubset(self, name, ExternalID, SystemID):
  4184.         """Create the internal subset of a document """
  4185.         ret = libxml2mod.xmlCreateIntSubset(self._o, name, ExternalID, SystemID)
  4186.         if ret is None:raise treeError('xmlCreateIntSubset() failed')
  4187.         __tmp = xmlDtd(_obj=ret)
  4188.         return __tmp
  4189.  
  4190.     def docCompressMode(self):
  4191.         """get the compression ratio for a document, ZLIB based """
  4192.         ret = libxml2mod.xmlGetDocCompressMode(self._o)
  4193.         return ret
  4194.  
  4195.     def dump(self, f):
  4196.         """Dump an XML document to an open FILE. """
  4197.         ret = libxml2mod.xmlDocDump(f, self._o)
  4198.         return ret
  4199.  
  4200.     def elemDump(self, f, cur):
  4201.         """Dump an XML/HTML node, recursive behaviour, children are
  4202.            printed too. """
  4203.         if cur is None: cur__o = None
  4204.         else: cur__o = cur._o
  4205.         libxml2mod.xmlElemDump(f, self._o, cur__o)
  4206.  
  4207.     def formatDump(self, f, format):
  4208.         """Dump an XML document to an open FILE. """
  4209.         ret = libxml2mod.xmlDocFormatDump(f, self._o, format)
  4210.         return ret
  4211.  
  4212.     def freeDoc(self):
  4213.         """Free up all the structures used by a document, tree
  4214.            included. """
  4215.         libxml2mod.xmlFreeDoc(self._o)
  4216.  
  4217.     def getRootElement(self):
  4218.         """Get the root element of the document (doc->children is a
  4219.            list containing possibly comments, PIs, etc ...). """
  4220.         ret = libxml2mod.xmlDocGetRootElement(self._o)
  4221.         if ret is None:raise treeError('xmlDocGetRootElement() failed')
  4222.         __tmp = xmlNode(_obj=ret)
  4223.         return __tmp
  4224.  
  4225.     def intSubset(self):
  4226.         """Get the internal subset of a document """
  4227.         ret = libxml2mod.xmlGetIntSubset(self._o)
  4228.         if ret is None:raise treeError('xmlGetIntSubset() failed')
  4229.         __tmp = xmlDtd(_obj=ret)
  4230.         return __tmp
  4231.  
  4232.     def newCDataBlock(self, content, len):
  4233.         """Creation of a new node containing a CDATA block. """
  4234.         ret = libxml2mod.xmlNewCDataBlock(self._o, content, len)
  4235.         if ret is None:raise treeError('xmlNewCDataBlock() failed')
  4236.         __tmp = xmlNode(_obj=ret)
  4237.         return __tmp
  4238.  
  4239.     def newCharRef(self, name):
  4240.         """Creation of a new character reference node. """
  4241.         ret = libxml2mod.xmlNewCharRef(self._o, name)
  4242.         if ret is None:raise treeError('xmlNewCharRef() failed')
  4243.         __tmp = xmlNode(_obj=ret)
  4244.         return __tmp
  4245.  
  4246.     def newDocComment(self, content):
  4247.         """Creation of a new node containing a comment within a
  4248.            document. """
  4249.         ret = libxml2mod.xmlNewDocComment(self._o, content)
  4250.         if ret is None:raise treeError('xmlNewDocComment() failed')
  4251.         __tmp = xmlNode(_obj=ret)
  4252.         return __tmp
  4253.  
  4254.     def newDocFragment(self):
  4255.         """Creation of a new Fragment node. """
  4256.         ret = libxml2mod.xmlNewDocFragment(self._o)
  4257.         if ret is None:raise treeError('xmlNewDocFragment() failed')
  4258.         __tmp = xmlNode(_obj=ret)
  4259.         return __tmp
  4260.  
  4261.     def newDocNode(self, ns, name, content):
  4262.         """Creation of a new node element within a document. @ns and
  4263.           @content are optional (None). NOTE: @content is supposed to
  4264.           be a piece of XML CDATA, so it allow entities references,
  4265.           but XML special chars need to be escaped first by using
  4266.           xmlEncodeEntitiesReentrant(). Use xmlNewDocRawNode() if you
  4267.            don't need entities support. """
  4268.         if ns is None: ns__o = None
  4269.         else: ns__o = ns._o
  4270.         ret = libxml2mod.xmlNewDocNode(self._o, ns__o, name, content)
  4271.         if ret is None:raise treeError('xmlNewDocNode() failed')
  4272.         __tmp = xmlNode(_obj=ret)
  4273.         return __tmp
  4274.  
  4275.     def newDocNodeEatName(self, ns, name, content):
  4276.         """Creation of a new node element within a document. @ns and
  4277.           @content are optional (None). NOTE: @content is supposed to
  4278.           be a piece of XML CDATA, so it allow entities references,
  4279.           but XML special chars need to be escaped first by using
  4280.           xmlEncodeEntitiesReentrant(). Use xmlNewDocRawNode() if you
  4281.            don't need entities support. """
  4282.         if ns is None: ns__o = None
  4283.         else: ns__o = ns._o
  4284.         ret = libxml2mod.xmlNewDocNodeEatName(self._o, ns__o, name, content)
  4285.         if ret is None:raise treeError('xmlNewDocNodeEatName() failed')
  4286.         __tmp = xmlNode(_obj=ret)
  4287.         return __tmp
  4288.  
  4289.     def newDocPI(self, name, content):
  4290.         """Creation of a processing instruction element. """
  4291.         ret = libxml2mod.xmlNewDocPI(self._o, name, content)
  4292.         if ret is None:raise treeError('xmlNewDocPI() failed')
  4293.         __tmp = xmlNode(_obj=ret)
  4294.         return __tmp
  4295.  
  4296.     def newDocProp(self, name, value):
  4297.         """Create a new property carried by a document. """
  4298.         ret = libxml2mod.xmlNewDocProp(self._o, name, value)
  4299.         if ret is None:raise treeError('xmlNewDocProp() failed')
  4300.         __tmp = xmlAttr(_obj=ret)
  4301.         return __tmp
  4302.  
  4303.     def newDocRawNode(self, ns, name, content):
  4304.         """Creation of a new node element within a document. @ns and
  4305.            @content are optional (None). """
  4306.         if ns is None: ns__o = None
  4307.         else: ns__o = ns._o
  4308.         ret = libxml2mod.xmlNewDocRawNode(self._o, ns__o, name, content)
  4309.         if ret is None:raise treeError('xmlNewDocRawNode() failed')
  4310.         __tmp = xmlNode(_obj=ret)
  4311.         return __tmp
  4312.  
  4313.     def newDocText(self, content):
  4314.         """Creation of a new text node within a document. """
  4315.         ret = libxml2mod.xmlNewDocText(self._o, content)
  4316.         if ret is None:raise treeError('xmlNewDocText() failed')
  4317.         __tmp = xmlNode(_obj=ret)
  4318.         return __tmp
  4319.  
  4320.     def newDocTextLen(self, content, len):
  4321.         """Creation of a new text node with an extra content length
  4322.            parameter. The text node pertain to a given document. """
  4323.         ret = libxml2mod.xmlNewDocTextLen(self._o, content, len)
  4324.         if ret is None:raise treeError('xmlNewDocTextLen() failed')
  4325.         __tmp = xmlNode(_obj=ret)
  4326.         return __tmp
  4327.  
  4328.     def newDtd(self, name, ExternalID, SystemID):
  4329.         """Creation of a new DTD for the external subset. To create an
  4330.            internal subset, use xmlCreateIntSubset(). """
  4331.         ret = libxml2mod.xmlNewDtd(self._o, name, ExternalID, SystemID)
  4332.         if ret is None:raise treeError('xmlNewDtd() failed')
  4333.         __tmp = xmlDtd(_obj=ret)
  4334.         return __tmp
  4335.  
  4336.     def newGlobalNs(self, href, prefix):
  4337.         """Creation of a Namespace, the old way using PI and without
  4338.            scoping DEPRECATED !!! """
  4339.         ret = libxml2mod.xmlNewGlobalNs(self._o, href, prefix)
  4340.         if ret is None:raise treeError('xmlNewGlobalNs() failed')
  4341.         __tmp = xmlNs(_obj=ret)
  4342.         return __tmp
  4343.  
  4344.     def newReference(self, name):
  4345.         """Creation of a new reference node. """
  4346.         ret = libxml2mod.xmlNewReference(self._o, name)
  4347.         if ret is None:raise treeError('xmlNewReference() failed')
  4348.         __tmp = xmlNode(_obj=ret)
  4349.         return __tmp
  4350.  
  4351.     def nodeDumpOutput(self, buf, cur, level, format, encoding):
  4352.         """Dump an XML node, recursive behaviour, children are printed
  4353.           too. Note that @format = 1 provide node indenting only if
  4354.           xmlIndentTreeOutput = 1 or xmlKeepBlanksDefault(0) was
  4355.            called """
  4356.         if buf is None: buf__o = None
  4357.         else: buf__o = buf._o
  4358.         if cur is None: cur__o = None
  4359.         else: cur__o = cur._o
  4360.         libxml2mod.xmlNodeDumpOutput(buf__o, self._o, cur__o, level, format, encoding)
  4361.  
  4362.     def nodeGetBase(self, cur):
  4363.         """Searches for the BASE URL. The code should work on both XML
  4364.           and HTML document even if base mechanisms are completely
  4365.           different. It returns the base as defined in RFC 2396
  4366.           sections 5.1.1. Base URI within Document Content and 5.1.2.
  4367.           Base URI from the Encapsulating Entity However it does not
  4368.            return the document base (5.1.3), use doc->URL in this case """
  4369.         if cur is None: cur__o = None
  4370.         else: cur__o = cur._o
  4371.         ret = libxml2mod.xmlNodeGetBase(self._o, cur__o)
  4372.         return ret
  4373.  
  4374.     def nodeListGetRawString(self, list, inLine):
  4375.         """Builds the string equivalent to the text contained in the
  4376.           Node list made of TEXTs and ENTITY_REFs, contrary to
  4377.           xmlNodeListGetString() this function doesn't do any
  4378.            character encoding handling. """
  4379.         if list is None: list__o = None
  4380.         else: list__o = list._o
  4381.         ret = libxml2mod.xmlNodeListGetRawString(self._o, list__o, inLine)
  4382.         return ret
  4383.  
  4384.     def nodeListGetString(self, list, inLine):
  4385.         """Build the string equivalent to the text contained in the
  4386.            Node list made of TEXTs and ENTITY_REFs """
  4387.         if list is None: list__o = None
  4388.         else: list__o = list._o
  4389.         ret = libxml2mod.xmlNodeListGetString(self._o, list__o, inLine)
  4390.         return ret
  4391.  
  4392.     def reconciliateNs(self, tree):
  4393.         """This function checks that all the namespaces declared
  4394.           within the given tree are properly declared. This is needed
  4395.           for example after Copy or Cut and then paste operations.
  4396.           The subtree may still hold pointers to namespace
  4397.           declarations outside the subtree or invalid/masked. As much
  4398.           as possible the function try to reuse the existing
  4399.           namespaces found in the new environment. If not possible
  4400.           the new namespaces are redeclared on @tree at the top of
  4401.            the given subtree. """
  4402.         if tree is None: tree__o = None
  4403.         else: tree__o = tree._o
  4404.         ret = libxml2mod.xmlReconciliateNs(self._o, tree__o)
  4405.         return ret
  4406.  
  4407.     def saveFile(self, filename):
  4408.         """Dump an XML document to a file. Will use compression if
  4409.           compiled in and enabled. If @filename is "-" the stdout
  4410.            file is used. """
  4411.         ret = libxml2mod.xmlSaveFile(filename, self._o)
  4412.         return ret
  4413.  
  4414.     def saveFileEnc(self, filename, encoding):
  4415.         """Dump an XML document, converting it to the given encoding """
  4416.         ret = libxml2mod.xmlSaveFileEnc(filename, self._o, encoding)
  4417.         return ret
  4418.  
  4419.     def saveFileTo(self, buf, encoding):
  4420.         """Dump an XML document to an I/O buffer. Warning ! This call
  4421.           xmlOutputBufferClose() on buf which is not available after
  4422.            this call. """
  4423.         if buf is None: buf__o = None
  4424.         else: buf__o = buf._o
  4425.         ret = libxml2mod.xmlSaveFileTo(buf__o, self._o, encoding)
  4426.         return ret
  4427.  
  4428.     def saveFormatFile(self, filename, format):
  4429.         """Dump an XML document to a file. Will use compression if
  4430.           compiled in and enabled. If @filename is "-" the stdout
  4431.           file is used. If @format is set then the document will be
  4432.           indented on output. Note that @format = 1 provide node
  4433.           indenting only if xmlIndentTreeOutput = 1 or
  4434.            xmlKeepBlanksDefault(0) was called """
  4435.         ret = libxml2mod.xmlSaveFormatFile(filename, self._o, format)
  4436.         return ret
  4437.  
  4438.     def saveFormatFileEnc(self, filename, encoding, format):
  4439.         """Dump an XML document to a file or an URL. """
  4440.         ret = libxml2mod.xmlSaveFormatFileEnc(filename, self._o, encoding, format)
  4441.         return ret
  4442.  
  4443.     def saveFormatFileTo(self, buf, encoding, format):
  4444.         """Dump an XML document to an I/O buffer. Warning ! This call
  4445.           xmlOutputBufferClose() on buf which is not available after
  4446.            this call. """
  4447.         if buf is None: buf__o = None
  4448.         else: buf__o = buf._o
  4449.         ret = libxml2mod.xmlSaveFormatFileTo(buf__o, self._o, encoding, format)
  4450.         return ret
  4451.  
  4452.     def searchNs(self, node, nameSpace):
  4453.         """Search a Ns registered under a given name space for a
  4454.           document. recurse on the parents until it finds the defined
  4455.           namespace or return None otherwise. @nameSpace can be None,
  4456.           this is a search for the default namespace. We don't allow
  4457.           to cross entities boundaries. If you don't declare the
  4458.           namespace within those you will be in troubles !!! A
  4459.            warning is generated to cover this case. """
  4460.         if node is None: node__o = None
  4461.         else: node__o = node._o
  4462.         ret = libxml2mod.xmlSearchNs(self._o, node__o, nameSpace)
  4463.         if ret is None:raise treeError('xmlSearchNs() failed')
  4464.         __tmp = xmlNs(_obj=ret)
  4465.         return __tmp
  4466.  
  4467.     def searchNsByHref(self, node, href):
  4468.         """Search a Ns aliasing a given URI. Recurse on the parents
  4469.           until it finds the defined namespace or return None
  4470.            otherwise. """
  4471.         if node is None: node__o = None
  4472.         else: node__o = node._o
  4473.         ret = libxml2mod.xmlSearchNsByHref(self._o, node__o, href)
  4474.         if ret is None:raise treeError('xmlSearchNsByHref() failed')
  4475.         __tmp = xmlNs(_obj=ret)
  4476.         return __tmp
  4477.  
  4478.     def setDocCompressMode(self, mode):
  4479.         """set the compression ratio for a document, ZLIB based
  4480.            Correct values: 0 (uncompressed) to 9 (max compression) """
  4481.         libxml2mod.xmlSetDocCompressMode(self._o, mode)
  4482.  
  4483.     def setListDoc(self, list):
  4484.         """update all nodes in the list to point to the right document """
  4485.         if list is None: list__o = None
  4486.         else: list__o = list._o
  4487.         libxml2mod.xmlSetListDoc(list__o, self._o)
  4488.  
  4489.     def setRootElement(self, root):
  4490.         """Set the root element of the document (doc->children is a
  4491.            list containing possibly comments, PIs, etc ...). """
  4492.         if root is None: root__o = None
  4493.         else: root__o = root._o
  4494.         ret = libxml2mod.xmlDocSetRootElement(self._o, root__o)
  4495.         if ret is None:return None
  4496.         __tmp = xmlNode(_obj=ret)
  4497.         return __tmp
  4498.  
  4499.     def setTreeDoc(self, tree):
  4500.         """update all nodes under the tree to point to the right
  4501.            document """
  4502.         if tree is None: tree__o = None
  4503.         else: tree__o = tree._o
  4504.         libxml2mod.xmlSetTreeDoc(tree__o, self._o)
  4505.  
  4506.     def stringGetNodeList(self, value):
  4507.         """Parse the value string and build the node list associated.
  4508.            Should produce a flat tree with only TEXTs and ENTITY_REFs. """
  4509.         ret = libxml2mod.xmlStringGetNodeList(self._o, value)
  4510.         if ret is None:raise treeError('xmlStringGetNodeList() failed')
  4511.         __tmp = xmlNode(_obj=ret)
  4512.         return __tmp
  4513.  
  4514.     def stringLenGetNodeList(self, value, len):
  4515.         """Parse the value string and build the node list associated.
  4516.            Should produce a flat tree with only TEXTs and ENTITY_REFs. """
  4517.         ret = libxml2mod.xmlStringLenGetNodeList(self._o, value, len)
  4518.         if ret is None:raise treeError('xmlStringLenGetNodeList() failed')
  4519.         __tmp = xmlNode(_obj=ret)
  4520.         return __tmp
  4521.  
  4522.     #
  4523.     # xmlDoc functions from module valid
  4524.     #
  4525.  
  4526.     def ID(self, ID):
  4527.         """Search the attribute declaring the given ID """
  4528.         ret = libxml2mod.xmlGetID(self._o, ID)
  4529.         if ret is None:raise treeError('xmlGetID() failed')
  4530.         __tmp = xmlAttr(_obj=ret)
  4531.         return __tmp
  4532.  
  4533.     def isID(self, elem, attr):
  4534.         """Determine whether an attribute is of type ID. In case we
  4535.           have DTD(s) then this is done if DTD loading has been
  4536.           requested. In the case of HTML documents parsed with the
  4537.            HTML parser, then ID detection is done systematically. """
  4538.         if elem is None: elem__o = None
  4539.         else: elem__o = elem._o
  4540.         if attr is None: attr__o = None
  4541.         else: attr__o = attr._o
  4542.         ret = libxml2mod.xmlIsID(self._o, elem__o, attr__o)
  4543.         return ret
  4544.  
  4545.     def isMixedElement(self, name):
  4546.         """Search in the DtDs whether an element accept Mixed content
  4547.            (or ANY) basically if it is supposed to accept text childs """
  4548.         ret = libxml2mod.xmlIsMixedElement(self._o, name)
  4549.         return ret
  4550.  
  4551.     def isRef(self, elem, attr):
  4552.         """Determine whether an attribute is of type Ref. In case we
  4553.           have DTD(s) then this is simple, otherwise we use an
  4554.            heuristic: name Ref (upper or lowercase). """
  4555.         if elem is None: elem__o = None
  4556.         else: elem__o = elem._o
  4557.         if attr is None: attr__o = None
  4558.         else: attr__o = attr._o
  4559.         ret = libxml2mod.xmlIsRef(self._o, elem__o, attr__o)
  4560.         return ret
  4561.  
  4562.     def removeID(self, attr):
  4563.         """Remove the given attribute from the ID table maintained
  4564.            internally. """
  4565.         if attr is None: attr__o = None
  4566.         else: attr__o = attr._o
  4567.         ret = libxml2mod.xmlRemoveID(self._o, attr__o)
  4568.         return ret
  4569.  
  4570.     def removeRef(self, attr):
  4571.         """Remove the given attribute from the Ref table maintained
  4572.            internally. """
  4573.         if attr is None: attr__o = None
  4574.         else: attr__o = attr._o
  4575.         ret = libxml2mod.xmlRemoveRef(self._o, attr__o)
  4576.         return ret
  4577.  
  4578.     def validCtxtNormalizeAttributeValue(self, ctxt, elem, name, value):
  4579.         """Does the validation related extra step of the normalization
  4580.           of attribute values:  If the declared value is not CDATA,
  4581.           then the XML processor must further process the normalized
  4582.           attribute value by discarding any leading and trailing
  4583.           space (#x20) characters, and by replacing sequences of
  4584.           space (#x20) characters by single space (#x20) character. 
  4585.           Also  check VC: Standalone Document Declaration in P32, and
  4586.            update ctxt->valid accordingly """
  4587.         if ctxt is None: ctxt__o = None
  4588.         else: ctxt__o = ctxt._o
  4589.         if elem is None: elem__o = None
  4590.         else: elem__o = elem._o
  4591.         ret = libxml2mod.xmlValidCtxtNormalizeAttributeValue(ctxt__o, self._o, elem__o, name, value)
  4592.         return ret
  4593.  
  4594.     def validNormalizeAttributeValue(self, elem, name, value):
  4595.         """Does the validation related extra step of the normalization
  4596.           of attribute values:  If the declared value is not CDATA,
  4597.           then the XML processor must further process the normalized
  4598.           attribute value by discarding any leading and trailing
  4599.           space (#x20) characters, and by replacing sequences of
  4600.            space (#x20) characters by single space (#x20) character. """
  4601.         if elem is None: elem__o = None
  4602.         else: elem__o = elem._o
  4603.         ret = libxml2mod.xmlValidNormalizeAttributeValue(self._o, elem__o, name, value)
  4604.         return ret
  4605.  
  4606.     def validateDocument(self, ctxt):
  4607.         """Try to validate the document instance  basically it does
  4608.           the all the checks described by the XML Rec i.e. validates
  4609.           the internal and external subset (if present) and validate
  4610.            the document tree. """
  4611.         if ctxt is None: ctxt__o = None
  4612.         else: ctxt__o = ctxt._o
  4613.         ret = libxml2mod.xmlValidateDocument(ctxt__o, self._o)
  4614.         return ret
  4615.  
  4616.     def validateDocumentFinal(self, ctxt):
  4617.         """Does the final step for the document validation once all
  4618.           the incremental validation steps have been completed 
  4619.           basically it does the following checks described by the XML
  4620.           Rec  Check all the IDREF/IDREFS attributes definition for
  4621.            validity """
  4622.         if ctxt is None: ctxt__o = None
  4623.         else: ctxt__o = ctxt._o
  4624.         ret = libxml2mod.xmlValidateDocumentFinal(ctxt__o, self._o)
  4625.         return ret
  4626.  
  4627.     def validateDtd(self, ctxt, dtd):
  4628.         """Try to validate the document against the dtd instance 
  4629.           Basically it does check all the definitions in the DtD.
  4630.           Note the the internal subset (if present) is de-coupled
  4631.           (i.e. not used), which could give problems if ID or IDREF
  4632.            is present. """
  4633.         if ctxt is None: ctxt__o = None
  4634.         else: ctxt__o = ctxt._o
  4635.         if dtd is None: dtd__o = None
  4636.         else: dtd__o = dtd._o
  4637.         ret = libxml2mod.xmlValidateDtd(ctxt__o, self._o, dtd__o)
  4638.         return ret
  4639.  
  4640.     def validateDtdFinal(self, ctxt):
  4641.         """Does the final step for the dtds validation once all the
  4642.           subsets have been parsed  basically it does the following
  4643.           checks described by the XML Rec - check that ENTITY and
  4644.           ENTITIES type attributes default or possible values matches
  4645.           one of the defined entities. - check that NOTATION type
  4646.           attributes default or possible values matches one of the
  4647.            defined notations. """
  4648.         if ctxt is None: ctxt__o = None
  4649.         else: ctxt__o = ctxt._o
  4650.         ret = libxml2mod.xmlValidateDtdFinal(ctxt__o, self._o)
  4651.         return ret
  4652.  
  4653.     def validateElement(self, ctxt, elem):
  4654.         """Try to validate the subtree under an element """
  4655.         if ctxt is None: ctxt__o = None
  4656.         else: ctxt__o = ctxt._o
  4657.         if elem is None: elem__o = None
  4658.         else: elem__o = elem._o
  4659.         ret = libxml2mod.xmlValidateElement(ctxt__o, self._o, elem__o)
  4660.         return ret
  4661.  
  4662.     def validateNotationUse(self, ctxt, notationName):
  4663.         """Validate that the given name match a notation declaration.
  4664.            - [ VC: Notation Declared ] """
  4665.         if ctxt is None: ctxt__o = None
  4666.         else: ctxt__o = ctxt._o
  4667.         ret = libxml2mod.xmlValidateNotationUse(ctxt__o, self._o, notationName)
  4668.         return ret
  4669.  
  4670.     def validateOneAttribute(self, ctxt, elem, attr, value):
  4671.         """Try to validate a single attribute for an element basically
  4672.           it does the following checks as described by the XML-1.0
  4673.           recommendation: - [ VC: Attribute Value Type ] - [ VC:
  4674.           Fixed Attribute Default ] - [ VC: Entity Name ] - [ VC:
  4675.           Name Token ] - [ VC: ID ] - [ VC: IDREF ] - [ VC: Entity
  4676.           Name ] - [ VC: Notation Attributes ]  The ID/IDREF
  4677.            uniqueness and matching are done separately """
  4678.         if ctxt is None: ctxt__o = None
  4679.         else: ctxt__o = ctxt._o
  4680.         if elem is None: elem__o = None
  4681.         else: elem__o = elem._o
  4682.         if attr is None: attr__o = None
  4683.         else: attr__o = attr._o
  4684.         ret = libxml2mod.xmlValidateOneAttribute(ctxt__o, self._o, elem__o, attr__o, value)
  4685.         return ret
  4686.  
  4687.     def validateOneElement(self, ctxt, elem):
  4688.         """Try to validate a single element and it's attributes,
  4689.           basically it does the following checks as described by the
  4690.           XML-1.0 recommendation: - [ VC: Element Valid ] - [ VC:
  4691.           Required Attribute ] Then call xmlValidateOneAttribute()
  4692.           for each attribute present.  The ID/IDREF checkings are
  4693.            done separately """
  4694.         if ctxt is None: ctxt__o = None
  4695.         else: ctxt__o = ctxt._o
  4696.         if elem is None: elem__o = None
  4697.         else: elem__o = elem._o
  4698.         ret = libxml2mod.xmlValidateOneElement(ctxt__o, self._o, elem__o)
  4699.         return ret
  4700.  
  4701.     def validateOneNamespace(self, ctxt, elem, prefix, ns, value):
  4702.         """Try to validate a single namespace declaration for an
  4703.           element basically it does the following checks as described
  4704.           by the XML-1.0 recommendation: - [ VC: Attribute Value Type
  4705.           ] - [ VC: Fixed Attribute Default ] - [ VC: Entity Name ] -
  4706.           [ VC: Name Token ] - [ VC: ID ] - [ VC: IDREF ] - [ VC:
  4707.           Entity Name ] - [ VC: Notation Attributes ]  The ID/IDREF
  4708.            uniqueness and matching are done separately """
  4709.         if ctxt is None: ctxt__o = None
  4710.         else: ctxt__o = ctxt._o
  4711.         if elem is None: elem__o = None
  4712.         else: elem__o = elem._o
  4713.         if ns is None: ns__o = None
  4714.         else: ns__o = ns._o
  4715.         ret = libxml2mod.xmlValidateOneNamespace(ctxt__o, self._o, elem__o, prefix, ns__o, value)
  4716.         return ret
  4717.  
  4718.     def validatePopElement(self, ctxt, elem, qname):
  4719.         """Pop the element end from the validation stack. """
  4720.         if ctxt is None: ctxt__o = None
  4721.         else: ctxt__o = ctxt._o
  4722.         if elem is None: elem__o = None
  4723.         else: elem__o = elem._o
  4724.         ret = libxml2mod.xmlValidatePopElement(ctxt__o, self._o, elem__o, qname)
  4725.         return ret
  4726.  
  4727.     def validatePushElement(self, ctxt, elem, qname):
  4728.         """Push a new element start on the validation stack. """
  4729.         if ctxt is None: ctxt__o = None
  4730.         else: ctxt__o = ctxt._o
  4731.         if elem is None: elem__o = None
  4732.         else: elem__o = elem._o
  4733.         ret = libxml2mod.xmlValidatePushElement(ctxt__o, self._o, elem__o, qname)
  4734.         return ret
  4735.  
  4736.     def validateRoot(self, ctxt):
  4737.         """Try to validate a the root element basically it does the
  4738.           following check as described by the XML-1.0 recommendation:
  4739.           - [ VC: Root Element Type ] it doesn't try to recurse or
  4740.            apply other check to the element """
  4741.         if ctxt is None: ctxt__o = None
  4742.         else: ctxt__o = ctxt._o
  4743.         ret = libxml2mod.xmlValidateRoot(ctxt__o, self._o)
  4744.         return ret
  4745.  
  4746.     #
  4747.     # xmlDoc functions from module xinclude
  4748.     #
  4749.  
  4750.     def xincludeProcess(self):
  4751.         """Implement the XInclude substitution on the XML document @doc """
  4752.         ret = libxml2mod.xmlXIncludeProcess(self._o)
  4753.         return ret
  4754.  
  4755.     def xincludeProcessFlags(self, flags):
  4756.         """Implement the XInclude substitution on the XML document @doc """
  4757.         ret = libxml2mod.xmlXIncludeProcessFlags(self._o, flags)
  4758.         return ret
  4759.  
  4760.     #
  4761.     # xmlDoc functions from module xmlreader
  4762.     #
  4763.  
  4764.     def NewWalker(self, reader):
  4765.         """Setup an xmltextReader to parse a preparsed XML document.
  4766.            This reuses the existing @reader xmlTextReader. """
  4767.         if reader is None: reader__o = None
  4768.         else: reader__o = reader._o
  4769.         ret = libxml2mod.xmlReaderNewWalker(reader__o, self._o)
  4770.         return ret
  4771.  
  4772.     def readerWalker(self):
  4773.         """Create an xmltextReader for a preparsed document. """
  4774.         ret = libxml2mod.xmlReaderWalker(self._o)
  4775.         if ret is None:raise treeError('xmlReaderWalker() failed')
  4776.         __tmp = xmlTextReader(_obj=ret)
  4777.         return __tmp
  4778.  
  4779.     #
  4780.     # xmlDoc functions from module xmlschemas
  4781.     #
  4782.  
  4783.     def schemaNewDocParserCtxt(self):
  4784.         """Create an XML Schemas parse context for that document. NB.
  4785.            The document may be modified during the parsing process. """
  4786.         ret = libxml2mod.xmlSchemaNewDocParserCtxt(self._o)
  4787.         if ret is None:raise parserError('xmlSchemaNewDocParserCtxt() failed')
  4788.         __tmp = SchemaParserCtxt(_obj=ret)
  4789.         return __tmp
  4790.  
  4791.     def schemaValidateDoc(self, ctxt):
  4792.         """Validate a document tree in memory. """
  4793.         if ctxt is None: ctxt__o = None
  4794.         else: ctxt__o = ctxt._o
  4795.         ret = libxml2mod.xmlSchemaValidateDoc(ctxt__o, self._o)
  4796.         return ret
  4797.  
  4798.     #
  4799.     # xmlDoc functions from module xpath
  4800.     #
  4801.  
  4802.     def xpathNewContext(self):
  4803.         """Create a new xmlXPathContext """
  4804.         ret = libxml2mod.xmlXPathNewContext(self._o)
  4805.         if ret is None:raise xpathError('xmlXPathNewContext() failed')
  4806.         __tmp = xpathContext(_obj=ret)
  4807.         return __tmp
  4808.  
  4809.     def xpathOrderDocElems(self):
  4810.         """Call this routine to speed up XPath computation on static
  4811.           documents. This stamps all the element nodes with the
  4812.           document order Like for line information, the order is kept
  4813.           in the element->content field, the value stored is actually
  4814.           - the node number (starting at -1) to be able to
  4815.            differentiate from line numbers. """
  4816.         ret = libxml2mod.xmlXPathOrderDocElems(self._o)
  4817.         return ret
  4818.  
  4819.     #
  4820.     # xmlDoc functions from module xpointer
  4821.     #
  4822.  
  4823.     def xpointerNewContext(self, here, origin):
  4824.         """Create a new XPointer context """
  4825.         if here is None: here__o = None
  4826.         else: here__o = here._o
  4827.         if origin is None: origin__o = None
  4828.         else: origin__o = origin._o
  4829.         ret = libxml2mod.xmlXPtrNewContext(self._o, here__o, origin__o)
  4830.         if ret is None:raise treeError('xmlXPtrNewContext() failed')
  4831.         __tmp = xpathContext(_obj=ret)
  4832.         return __tmp
  4833.  
  4834. class parserCtxt(parserCtxtCore):
  4835.     def __init__(self, _obj=None):
  4836.         self._o = _obj
  4837.         parserCtxtCore.__init__(self, _obj=_obj)
  4838.  
  4839.     def __del__(self):
  4840.         if self._o != None:
  4841.             libxml2mod.xmlFreeParserCtxt(self._o)
  4842.         self._o = None
  4843.  
  4844.     # accessors for parserCtxt
  4845.     def doc(self):
  4846.         """Get the document tree from a parser context. """
  4847.         ret = libxml2mod.xmlParserGetDoc(self._o)
  4848.         if ret is None:raise parserError('xmlParserGetDoc() failed')
  4849.         __tmp = xmlDoc(_obj=ret)
  4850.         return __tmp
  4851.  
  4852.     def isValid(self):
  4853.         """Get the validity information from a parser context. """
  4854.         ret = libxml2mod.xmlParserGetIsValid(self._o)
  4855.         return ret
  4856.  
  4857.     def lineNumbers(self, linenumbers):
  4858.         """Switch on the generation of line number for elements nodes. """
  4859.         libxml2mod.xmlParserSetLineNumbers(self._o, linenumbers)
  4860.  
  4861.     def loadSubset(self, loadsubset):
  4862.         """Switch the parser to load the DTD without validating. """
  4863.         libxml2mod.xmlParserSetLoadSubset(self._o, loadsubset)
  4864.  
  4865.     def pedantic(self, pedantic):
  4866.         """Switch the parser to be pedantic. """
  4867.         libxml2mod.xmlParserSetPedantic(self._o, pedantic)
  4868.  
  4869.     def replaceEntities(self, replaceEntities):
  4870.         """Switch the parser to replace entities. """
  4871.         libxml2mod.xmlParserSetReplaceEntities(self._o, replaceEntities)
  4872.  
  4873.     def validate(self, validate):
  4874.         """Switch the parser to validation mode. """
  4875.         libxml2mod.xmlParserSetValidate(self._o, validate)
  4876.  
  4877.     def wellFormed(self):
  4878.         """Get the well formed information from a parser context. """
  4879.         ret = libxml2mod.xmlParserGetWellFormed(self._o)
  4880.         return ret
  4881.  
  4882.     #
  4883.     # parserCtxt functions from module HTMLparser
  4884.     #
  4885.  
  4886.     def htmlCtxtReadDoc(self, cur, URL, encoding, options):
  4887.         """parse an XML in-memory document and build a tree. This
  4888.            reuses the existing @ctxt parser context """
  4889.         ret = libxml2mod.htmlCtxtReadDoc(self._o, cur, URL, encoding, options)
  4890.         if ret is None:raise treeError('htmlCtxtReadDoc() failed')
  4891.         __tmp = xmlDoc(_obj=ret)
  4892.         return __tmp
  4893.  
  4894.     def htmlCtxtReadFd(self, fd, URL, encoding, options):
  4895.         """parse an XML from a file descriptor and build a tree. This
  4896.            reuses the existing @ctxt parser context """
  4897.         ret = libxml2mod.htmlCtxtReadFd(self._o, fd, URL, encoding, options)
  4898.         if ret is None:raise treeError('htmlCtxtReadFd() failed')
  4899.         __tmp = xmlDoc(_obj=ret)
  4900.         return __tmp
  4901.  
  4902.     def htmlCtxtReadFile(self, filename, encoding, options):
  4903.         """parse an XML file from the filesystem or the network. This
  4904.            reuses the existing @ctxt parser context """
  4905.         ret = libxml2mod.htmlCtxtReadFile(self._o, filename, encoding, options)
  4906.         if ret is None:raise treeError('htmlCtxtReadFile() failed')
  4907.         __tmp = xmlDoc(_obj=ret)
  4908.         return __tmp
  4909.  
  4910.     def htmlCtxtReadMemory(self, buffer, size, URL, encoding, options):
  4911.         """parse an XML in-memory document and build a tree. This
  4912.            reuses the existing @ctxt parser context """
  4913.         ret = libxml2mod.htmlCtxtReadMemory(self._o, buffer, size, URL, encoding, options)
  4914.         if ret is None:raise treeError('htmlCtxtReadMemory() failed')
  4915.         __tmp = xmlDoc(_obj=ret)
  4916.         return __tmp
  4917.  
  4918.     def htmlCtxtReset(self):
  4919.         """Reset a parser context """
  4920.         libxml2mod.htmlCtxtReset(self._o)
  4921.  
  4922.     def htmlCtxtUseOptions(self, options):
  4923.         """Applies the options to the parser context """
  4924.         ret = libxml2mod.htmlCtxtUseOptions(self._o, options)
  4925.         return ret
  4926.  
  4927.     def htmlFreeParserCtxt(self):
  4928.         """Free all the memory used by a parser context. However the
  4929.            parsed document in ctxt->myDoc is not freed. """
  4930.         libxml2mod.htmlFreeParserCtxt(self._o)
  4931.  
  4932.     def htmlParseCharRef(self):
  4933.         """parse Reference declarations  [66] CharRef ::= '&#' [0-9]+
  4934.            ';' | '&#x' [0-9a-fA-F]+ ';' """
  4935.         ret = libxml2mod.htmlParseCharRef(self._o)
  4936.         return ret
  4937.  
  4938.     def htmlParseChunk(self, chunk, size, terminate):
  4939.         """Parse a Chunk of memory """
  4940.         ret = libxml2mod.htmlParseChunk(self._o, chunk, size, terminate)
  4941.         return ret
  4942.  
  4943.     def htmlParseDocument(self):
  4944.         """parse an HTML document (and build a tree if using the
  4945.            standard SAX interface). """
  4946.         ret = libxml2mod.htmlParseDocument(self._o)
  4947.         return ret
  4948.  
  4949.     def htmlParseElement(self):
  4950.         """parse an HTML element, this is highly recursive this is
  4951.           kept for compatibility with previous code versions  [39]
  4952.           element ::= EmptyElemTag | STag content ETag  [41]
  4953.            Attribute ::= Name Eq AttValue """
  4954.         libxml2mod.htmlParseElement(self._o)
  4955.  
  4956.     #
  4957.     # parserCtxt functions from module parser
  4958.     #
  4959.  
  4960.     def byteConsumed(self):
  4961.         """This function provides the current index of the parser
  4962.           relative to the start of the current entity. This function
  4963.           is computed in bytes from the beginning starting at zero
  4964.           and finishing at the size in byte of the file if parsing a
  4965.           file. The function is of constant cost if the input is
  4966.            UTF-8 but can be costly if run on non-UTF-8 input. """
  4967.         ret = libxml2mod.xmlByteConsumed(self._o)
  4968.         return ret
  4969.  
  4970.     def clearParserCtxt(self):
  4971.         """Clear (release owned resources) and reinitialize a parser
  4972.            context """
  4973.         libxml2mod.xmlClearParserCtxt(self._o)
  4974.  
  4975.     def ctxtReadDoc(self, cur, URL, encoding, options):
  4976.         """parse an XML in-memory document and build a tree. This
  4977.            reuses the existing @ctxt parser context """
  4978.         ret = libxml2mod.xmlCtxtReadDoc(self._o, cur, URL, encoding, options)
  4979.         if ret is None:raise treeError('xmlCtxtReadDoc() failed')
  4980.         __tmp = xmlDoc(_obj=ret)
  4981.         return __tmp
  4982.  
  4983.     def ctxtReadFd(self, fd, URL, encoding, options):
  4984.         """parse an XML from a file descriptor and build a tree. This
  4985.           reuses the existing @ctxt parser context NOTE that the file
  4986.           descriptor will not be closed when the reader is closed or
  4987.            reset. """
  4988.         ret = libxml2mod.xmlCtxtReadFd(self._o, fd, URL, encoding, options)
  4989.         if ret is None:raise treeError('xmlCtxtReadFd() failed')
  4990.         __tmp = xmlDoc(_obj=ret)
  4991.         return __tmp
  4992.  
  4993.     def ctxtReadFile(self, filename, encoding, options):
  4994.         """parse an XML file from the filesystem or the network. This
  4995.            reuses the existing @ctxt parser context """
  4996.         ret = libxml2mod.xmlCtxtReadFile(self._o, filename, encoding, options)
  4997.         if ret is None:raise treeError('xmlCtxtReadFile() failed')
  4998.         __tmp = xmlDoc(_obj=ret)
  4999.         return __tmp
  5000.  
  5001.     def ctxtReadMemory(self, buffer, size, URL, encoding, options):
  5002.         """parse an XML in-memory document and build a tree. This
  5003.            reuses the existing @ctxt parser context """
  5004.         ret = libxml2mod.xmlCtxtReadMemory(self._o, buffer, size, URL, encoding, options)
  5005.         if ret is None:raise treeError('xmlCtxtReadMemory() failed')
  5006.         __tmp = xmlDoc(_obj=ret)
  5007.         return __tmp
  5008.  
  5009.     def ctxtReset(self):
  5010.         """Reset a parser context """
  5011.         libxml2mod.xmlCtxtReset(self._o)
  5012.  
  5013.     def ctxtResetPush(self, chunk, size, filename, encoding):
  5014.         """Reset a push parser context """
  5015.         ret = libxml2mod.xmlCtxtResetPush(self._o, chunk, size, filename, encoding)
  5016.         return ret
  5017.  
  5018.     def ctxtUseOptions(self, options):
  5019.         """Applies the options to the parser context """
  5020.         ret = libxml2mod.xmlCtxtUseOptions(self._o, options)
  5021.         return ret
  5022.  
  5023.     def initParserCtxt(self):
  5024.         """Initialize a parser context """
  5025.         ret = libxml2mod.xmlInitParserCtxt(self._o)
  5026.         return ret
  5027.  
  5028.     def parseChunk(self, chunk, size, terminate):
  5029.         """Parse a Chunk of memory """
  5030.         ret = libxml2mod.xmlParseChunk(self._o, chunk, size, terminate)
  5031.         return ret
  5032.  
  5033.     def parseDocument(self):
  5034.         """parse an XML document (and build a tree if using the
  5035.           standard SAX interface).  [1] document ::= prolog element
  5036.            Misc*  [22] prolog ::= XMLDecl? Misc* (doctypedecl Misc*)? """
  5037.         ret = libxml2mod.xmlParseDocument(self._o)
  5038.         return ret
  5039.  
  5040.     def parseExtParsedEnt(self):
  5041.         """parse a general parsed entity An external general parsed
  5042.           entity is well-formed if it matches the production labeled
  5043.            extParsedEnt.  [78] extParsedEnt ::= TextDecl? content """
  5044.         ret = libxml2mod.xmlParseExtParsedEnt(self._o)
  5045.         return ret
  5046.  
  5047.     def setupParserForBuffer(self, buffer, filename):
  5048.         """Setup the parser context to parse a new buffer; Clears any
  5049.           prior contents from the parser context. The buffer
  5050.           parameter must not be None, but the filename parameter can
  5051.            be """
  5052.         libxml2mod.xmlSetupParserForBuffer(self._o, buffer, filename)
  5053.  
  5054.     def stopParser(self):
  5055.         """Blocks further parser processing """
  5056.         libxml2mod.xmlStopParser(self._o)
  5057.  
  5058.     #
  5059.     # parserCtxt functions from module parserInternals
  5060.     #
  5061.  
  5062.     def decodeEntities(self, len, what, end, end2, end3):
  5063.         """This function is deprecated, we now always process entities
  5064.           content through xmlStringDecodeEntities  TODO: remove it in
  5065.           next major release.  [67] Reference ::= EntityRef | CharRef
  5066.             [69] PEReference ::= '%' Name ';' """
  5067.         ret = libxml2mod.xmlDecodeEntities(self._o, len, what, end, end2, end3)
  5068.         return ret
  5069.  
  5070.     def handleEntity(self, entity):
  5071.         """Default handling of defined entities, when should we define
  5072.           a new input stream ? When do we just handle that as a set
  5073.            of chars ?  OBSOLETE: to be removed at some point. """
  5074.         if entity is None: entity__o = None
  5075.         else: entity__o = entity._o
  5076.         libxml2mod.xmlHandleEntity(self._o, entity__o)
  5077.  
  5078.     def namespaceParseNCName(self):
  5079.         """parse an XML namespace name.  TODO: this seems not in use
  5080.           anymore, the namespace handling is done on top of the SAX
  5081.           interfaces, i.e. not on raw input.  [NS 3] NCName ::=
  5082.           (Letter | '_') (NCNameChar)*  [NS 4] NCNameChar ::= Letter
  5083.            | Digit | '.' | '-' | '_' | CombiningChar | Extender """
  5084.         ret = libxml2mod.xmlNamespaceParseNCName(self._o)
  5085.         return ret
  5086.  
  5087.     def namespaceParseNSDef(self):
  5088.         """parse a namespace prefix declaration  TODO: this seems not
  5089.           in use anymore, the namespace handling is done on top of
  5090.           the SAX interfaces, i.e. not on raw input.  [NS 1] NSDef
  5091.           ::= PrefixDef Eq SystemLiteral  [NS 2] PrefixDef ::=
  5092.            'xmlns' (':' NCName)? """
  5093.         ret = libxml2mod.xmlNamespaceParseNSDef(self._o)
  5094.         return ret
  5095.  
  5096.     def nextChar(self):
  5097.         """Skip to the next char input char. """
  5098.         libxml2mod.xmlNextChar(self._o)
  5099.  
  5100.     def parseAttValue(self):
  5101.         """parse a value for an attribute Note: the parser won't do
  5102.           substitution of entities here, this will be handled later
  5103.           in xmlStringGetNodeList  [10] AttValue ::= '"' ([^<&"] |
  5104.           Reference)* '"' | "'" ([^<&'] | Reference)* "'"  3.3.3
  5105.           Attribute-Value Normalization: Before the value of an
  5106.           attribute is passed to the application or checked for
  5107.           validity, the XML processor must normalize it as follows: -
  5108.           a character reference is processed by appending the
  5109.           referenced character to the attribute value - an entity
  5110.           reference is processed by recursively processing the
  5111.           replacement text of the entity - a whitespace character
  5112.           (#x20, #xD, #xA, #x9) is processed by appending #x20 to the
  5113.           normalized value, except that only a single #x20 is
  5114.           appended for a "#xD#xA" sequence that is part of an
  5115.           external parsed entity or the literal entity value of an
  5116.           internal parsed entity - other characters are processed by
  5117.           appending them to the normalized value If the declared
  5118.           value is not CDATA, then the XML processor must further
  5119.           process the normalized attribute value by discarding any
  5120.           leading and trailing space (#x20) characters, and by
  5121.           replacing sequences of space (#x20) characters by a single
  5122.           space (#x20) character. All attributes for which no
  5123.           declaration has been read should be treated by a
  5124.            non-validating parser as if declared CDATA. """
  5125.         ret = libxml2mod.xmlParseAttValue(self._o)
  5126.         return ret
  5127.  
  5128.     def parseAttributeListDecl(self):
  5129.         """: parse the Attribute list def for an element  [52]
  5130.           AttlistDecl ::= '<!ATTLIST' S Name AttDef* S? '>'  [53]
  5131.            AttDef ::= S Name S AttType S DefaultDecl """
  5132.         libxml2mod.xmlParseAttributeListDecl(self._o)
  5133.  
  5134.     def parseCDSect(self):
  5135.         """Parse escaped pure raw content.  [18] CDSect ::= CDStart
  5136.           CData CDEnd  [19] CDStart ::= '<![CDATA['  [20] Data ::=
  5137.            (Char* - (Char* ']]>' Char*))  [21] CDEnd ::= ']]>' """
  5138.         libxml2mod.xmlParseCDSect(self._o)
  5139.  
  5140.     def parseCharData(self, cdata):
  5141.         """parse a CharData section. if we are within a CDATA section
  5142.           ']]>' marks an end of section.  The right angle bracket (>)
  5143.           may be represented using the string ">", and must, for
  5144.           compatibility, be escaped using ">" or a character
  5145.           reference when it appears in the string "]]>" in content,
  5146.           when that string is not marking the end of a CDATA section.
  5147.             [14] CharData ::= [^<&]* - ([^<&]* ']]>' [^<&]*) """
  5148.         libxml2mod.xmlParseCharData(self._o, cdata)
  5149.  
  5150.     def parseCharRef(self):
  5151.         """parse Reference declarations  [66] CharRef ::= '&#' [0-9]+
  5152.           ';' | '&#x' [0-9a-fA-F]+ ';'  [ WFC: Legal Character ]
  5153.           Characters referred to using character references must
  5154.            match the production for Char. """
  5155.         ret = libxml2mod.xmlParseCharRef(self._o)
  5156.         return ret
  5157.  
  5158.     def parseComment(self):
  5159.         """Skip an XML (SGML) comment <!-- .... --> The spec says that
  5160.           "For compatibility, the string "--" (double-hyphen) must
  5161.           not occur within comments. "  [15] Comment ::= '<!--'
  5162.            ((Char - '-') | ('-' (Char - '-')))* '-->' """
  5163.         libxml2mod.xmlParseComment(self._o)
  5164.  
  5165.     def parseContent(self):
  5166.         """Parse a content:  [43] content ::= (element | CharData |
  5167.            Reference | CDSect | PI | Comment)* """
  5168.         libxml2mod.xmlParseContent(self._o)
  5169.  
  5170.     def parseDocTypeDecl(self):
  5171.         """parse a DOCTYPE declaration  [28] doctypedecl ::=
  5172.           '<!DOCTYPE' S Name (S ExternalID)? S? ('[' (markupdecl |
  5173.           PEReference | S)* ']' S?)? '>'  [ VC: Root Element Type ]
  5174.           The Name in the document type declaration must match the
  5175.            element type of the root element. """
  5176.         libxml2mod.xmlParseDocTypeDecl(self._o)
  5177.  
  5178.     def parseElement(self):
  5179.         """parse an XML element, this is highly recursive  [39]
  5180.           element ::= EmptyElemTag | STag content ETag  [ WFC:
  5181.           Element Type Match ] The Name in an element's end-tag must
  5182.            match the element type in the start-tag. """
  5183.         libxml2mod.xmlParseElement(self._o)
  5184.  
  5185.     def parseElementDecl(self):
  5186.         """parse an Element declaration.  [45] elementdecl ::=
  5187.           '<!ELEMENT' S Name S contentspec S? '>'  [ VC: Unique
  5188.           Element Type Declaration ] No element type may be declared
  5189.            more than once """
  5190.         ret = libxml2mod.xmlParseElementDecl(self._o)
  5191.         return ret
  5192.  
  5193.     def parseEncName(self):
  5194.         """parse the XML encoding name  [81] EncName ::= [A-Za-z]
  5195.            ([A-Za-z0-9._] | '-')* """
  5196.         ret = libxml2mod.xmlParseEncName(self._o)
  5197.         return ret
  5198.  
  5199.     def parseEncodingDecl(self):
  5200.         """parse the XML encoding declaration  [80] EncodingDecl ::= S
  5201.           'encoding' Eq ('"' EncName '"' |  "'" EncName "'")  this
  5202.            setups the conversion filters. """
  5203.         ret = libxml2mod.xmlParseEncodingDecl(self._o)
  5204.         return ret
  5205.  
  5206.     def parseEndTag(self):
  5207.         """parse an end of tag  [42] ETag ::= '</' Name S? '>'  With
  5208.            namespace  [NS 9] ETag ::= '</' QName S? '>' """
  5209.         libxml2mod.xmlParseEndTag(self._o)
  5210.  
  5211.     def parseEntityDecl(self):
  5212.         """parse <!ENTITY declarations  [70] EntityDecl ::= GEDecl |
  5213.           PEDecl  [71] GEDecl ::= '<!ENTITY' S Name S EntityDef S?
  5214.           '>'  [72] PEDecl ::= '<!ENTITY' S '%' S Name S PEDef S? '>'
  5215.           [73] EntityDef ::= EntityValue | (ExternalID NDataDecl?) 
  5216.           [74] PEDef ::= EntityValue | ExternalID  [76] NDataDecl ::=
  5217.           S 'NDATA' S Name  [ VC: Notation Declared ] The Name must
  5218.            match the declared name of a notation. """
  5219.         libxml2mod.xmlParseEntityDecl(self._o)
  5220.  
  5221.     def parseEntityRef(self):
  5222.         """parse ENTITY references declarations  [68] EntityRef ::=
  5223.           '&' Name ';'  [ WFC: Entity Declared ] In a document
  5224.           without any DTD, a document with only an internal DTD
  5225.           subset which contains no parameter entity references, or a
  5226.           document with "standalone='yes'", the Name given in the
  5227.           entity reference must match that in an entity declaration,
  5228.           except that well-formed documents need not declare any of
  5229.           the following entities: amp, lt, gt, apos, quot.  The
  5230.           declaration of a parameter entity must precede any
  5231.           reference to it.  Similarly, the declaration of a general
  5232.           entity must precede any reference to it which appears in a
  5233.           default value in an attribute-list declaration. Note that
  5234.           if entities are declared in the external subset or in
  5235.           external parameter entities, a non-validating processor is
  5236.           not obligated to read and process their declarations; for
  5237.           such documents, the rule that an entity must be declared is
  5238.           a well-formedness constraint only if standalone='yes'.  [
  5239.           WFC: Parsed Entity ] An entity reference must not contain
  5240.            the name of an unparsed entity """
  5241.         ret = libxml2mod.xmlParseEntityRef(self._o)
  5242.         if ret is None:raise parserError('xmlParseEntityRef() failed')
  5243.         __tmp = xmlEntity(_obj=ret)
  5244.         return __tmp
  5245.  
  5246.     def parseExternalSubset(self, ExternalID, SystemID):
  5247.         """parse Markup declarations from an external subset  [30]
  5248.           extSubset ::= textDecl? extSubsetDecl  [31] extSubsetDecl
  5249.            ::= (markupdecl | conditionalSect | PEReference | S) * """
  5250.         libxml2mod.xmlParseExternalSubset(self._o, ExternalID, SystemID)
  5251.  
  5252.     def parseMarkupDecl(self):
  5253.         """parse Markup declarations  [29] markupdecl ::= elementdecl
  5254.           | AttlistDecl | EntityDecl | NotationDecl | PI | Comment  [
  5255.           VC: Proper Declaration/PE Nesting ] Parameter-entity
  5256.           replacement text must be properly nested with markup
  5257.           declarations. That is to say, if either the first character
  5258.           or the last character of a markup declaration (markupdecl
  5259.           above) is contained in the replacement text for a
  5260.           parameter-entity reference, both must be contained in the
  5261.           same replacement text.  [ WFC: PEs in Internal Subset ] In
  5262.           the internal DTD subset, parameter-entity references can
  5263.           occur only where markup declarations can occur, not within
  5264.           markup declarations. (This does not apply to references
  5265.           that occur in external parameter entities or to the
  5266.            external subset.) """
  5267.         libxml2mod.xmlParseMarkupDecl(self._o)
  5268.  
  5269.     def parseMisc(self):
  5270.         """parse an XML Misc* optional field.  [27] Misc ::= Comment |
  5271.            PI |  S """
  5272.         libxml2mod.xmlParseMisc(self._o)
  5273.  
  5274.     def parseName(self):
  5275.         """parse an XML name.  [4] NameChar ::= Letter | Digit | '.' |
  5276.           '-' | '_' | ':' | CombiningChar | Extender  [5] Name ::=
  5277.           (Letter | '_' | ':') (NameChar)*  [6] Names ::= Name (#x20
  5278.            Name)* """
  5279.         ret = libxml2mod.xmlParseName(self._o)
  5280.         return ret
  5281.  
  5282.     def parseNamespace(self):
  5283.         """xmlParseNamespace: parse specific PI '<?namespace ...'
  5284.           constructs.  This is what the older xml-name Working Draft
  5285.           specified, a bunch of other stuff may still rely on it, so
  5286.           support is still here as if it was declared on the root of
  5287.           the Tree:-(  TODO: remove from library  To be removed at
  5288.            next drop of binary compatibility """
  5289.         libxml2mod.xmlParseNamespace(self._o)
  5290.  
  5291.     def parseNmtoken(self):
  5292.         """parse an XML Nmtoken.  [7] Nmtoken ::= (NameChar)+  [8]
  5293.            Nmtokens ::= Nmtoken (#x20 Nmtoken)* """
  5294.         ret = libxml2mod.xmlParseNmtoken(self._o)
  5295.         return ret
  5296.  
  5297.     def parseNotationDecl(self):
  5298.         """parse a notation declaration  [82] NotationDecl ::=
  5299.           '<!NOTATION' S Name S (ExternalID |  PublicID) S? '>' 
  5300.           Hence there is actually 3 choices: 'PUBLIC' S PubidLiteral
  5301.           'PUBLIC' S PubidLiteral S SystemLiteral and 'SYSTEM' S
  5302.            SystemLiteral  See the NOTE on xmlParseExternalID(). """
  5303.         libxml2mod.xmlParseNotationDecl(self._o)
  5304.  
  5305.     def parsePEReference(self):
  5306.         """parse PEReference declarations The entity content is
  5307.           handled directly by pushing it's content as a new input
  5308.           stream.  [69] PEReference ::= '%' Name ';'  [ WFC: No
  5309.           Recursion ] A parsed entity must not contain a recursive
  5310.           reference to itself, either directly or indirectly.  [ WFC:
  5311.           Entity Declared ] In a document without any DTD, a document
  5312.           with only an internal DTD subset which contains no
  5313.           parameter entity references, or a document with
  5314.           "standalone='yes'", ...  ... The declaration of a parameter
  5315.           entity must precede any reference to it...  [ VC: Entity
  5316.           Declared ] In a document with an external subset or
  5317.           external parameter entities with "standalone='no'", ... 
  5318.           ... The declaration of a parameter entity must precede any
  5319.           reference to it...  [ WFC: In DTD ] Parameter-entity
  5320.           references may only appear in the DTD. NOTE: misleading but
  5321.            this is handled. """
  5322.         libxml2mod.xmlParsePEReference(self._o)
  5323.  
  5324.     def parsePI(self):
  5325.         """parse an XML Processing Instruction.  [16] PI ::= '<?'
  5326.           PITarget (S (Char* - (Char* '?>' Char*)))? '?>'  The
  5327.            processing is transfered to SAX once parsed. """
  5328.         libxml2mod.xmlParsePI(self._o)
  5329.  
  5330.     def parsePITarget(self):
  5331.         """parse the name of a PI  [17] PITarget ::= Name - (('X' |
  5332.            'x') ('M' | 'm') ('L' | 'l')) """
  5333.         ret = libxml2mod.xmlParsePITarget(self._o)
  5334.         return ret
  5335.  
  5336.     def parsePubidLiteral(self):
  5337.         """parse an XML public literal  [12] PubidLiteral ::= '"'
  5338.            PubidChar* '"' | "'" (PubidChar - "'")* "'" """
  5339.         ret = libxml2mod.xmlParsePubidLiteral(self._o)
  5340.         return ret
  5341.  
  5342.     def parseQuotedString(self):
  5343.         """Parse and return a string between quotes or doublequotes 
  5344.           TODO: Deprecated, to  be removed at next drop of binary
  5345.            compatibility """
  5346.         ret = libxml2mod.xmlParseQuotedString(self._o)
  5347.         return ret
  5348.  
  5349.     def parseReference(self):
  5350.         """parse and handle entity references in content, depending on
  5351.           the SAX interface, this may end-up in a call to character()
  5352.           if this is a CharRef, a predefined entity, if there is no
  5353.           reference() callback. or if the parser was asked to switch
  5354.            to that mode.  [67] Reference ::= EntityRef | CharRef """
  5355.         libxml2mod.xmlParseReference(self._o)
  5356.  
  5357.     def parseSDDecl(self):
  5358.         """parse the XML standalone declaration  [32] SDDecl ::= S
  5359.           'standalone' Eq (("'" ('yes' | 'no') "'") | ('"' ('yes' |
  5360.           'no')'"'))  [ VC: Standalone Document Declaration ] TODO
  5361.           The standalone document declaration must have the value
  5362.           "no" if any external markup declarations contain
  5363.           declarations of: - attributes with default values, if
  5364.           elements to which these attributes apply appear in the
  5365.           document without specifications of values for these
  5366.           attributes, or - entities (other than amp, lt, gt, apos,
  5367.           quot), if references to those entities appear in the
  5368.           document, or - attributes with values subject to
  5369.           normalization, where the attribute appears in the document
  5370.           with a value which will change as a result of
  5371.           normalization, or - element types with element content, if
  5372.           white space occurs directly within any instance of those
  5373.            types. """
  5374.         ret = libxml2mod.xmlParseSDDecl(self._o)
  5375.         return ret
  5376.  
  5377.     def parseStartTag(self):
  5378.         """parse a start of tag either for rule element or
  5379.           EmptyElement. In both case we don't parse the tag closing
  5380.           chars.  [40] STag ::= '<' Name (S Attribute)* S? '>'  [
  5381.           WFC: Unique Att Spec ] No attribute name may appear more
  5382.           than once in the same start-tag or empty-element tag.  [44]
  5383.           EmptyElemTag ::= '<' Name (S Attribute)* S? '/>'  [ WFC:
  5384.           Unique Att Spec ] No attribute name may appear more than
  5385.           once in the same start-tag or empty-element tag.  With
  5386.           namespace:  [NS 8] STag ::= '<' QName (S Attribute)* S? '>'
  5387.             [NS 10] EmptyElement ::= '<' QName (S Attribute)* S? '/>' """
  5388.         ret = libxml2mod.xmlParseStartTag(self._o)
  5389.         return ret
  5390.  
  5391.     def parseSystemLiteral(self):
  5392.         """parse an XML Literal  [11] SystemLiteral ::= ('"' [^"]*
  5393.            '"') | ("'" [^']* "'") """
  5394.         ret = libxml2mod.xmlParseSystemLiteral(self._o)
  5395.         return ret
  5396.  
  5397.     def parseTextDecl(self):
  5398.         """parse an XML declaration header for external entities  [77]
  5399.            TextDecl ::= '<?xml' VersionInfo? EncodingDecl S? '?>' """
  5400.         libxml2mod.xmlParseTextDecl(self._o)
  5401.  
  5402.     def parseVersionInfo(self):
  5403.         """parse the XML version.  [24] VersionInfo ::= S 'version' Eq
  5404.            (' VersionNum ' | " VersionNum ")  [25] Eq ::= S? '=' S? """
  5405.         ret = libxml2mod.xmlParseVersionInfo(self._o)
  5406.         return ret
  5407.  
  5408.     def parseVersionNum(self):
  5409.         """parse the XML version value.  [26] VersionNum ::= '1.'
  5410.            [0-9]+  In practice allow [0-9].[0-9]+ at that level """
  5411.         ret = libxml2mod.xmlParseVersionNum(self._o)
  5412.         return ret
  5413.  
  5414.     def parseXMLDecl(self):
  5415.         """parse an XML declaration header  [23] XMLDecl ::= '<?xml'
  5416.            VersionInfo EncodingDecl? SDDecl? S? '?>' """
  5417.         libxml2mod.xmlParseXMLDecl(self._o)
  5418.  
  5419.     def parserHandlePEReference(self):
  5420.         """[69] PEReference ::= '%' Name ';'  [ WFC: No Recursion ] A
  5421.           parsed entity must not contain a recursive reference to
  5422.           itself, either directly or indirectly.  [ WFC: Entity
  5423.           Declared ] In a document without any DTD, a document with
  5424.           only an internal DTD subset which contains no parameter
  5425.           entity references, or a document with "standalone='yes'",
  5426.           ...  ... The declaration of a parameter entity must precede
  5427.           any reference to it...  [ VC: Entity Declared ] In a
  5428.           document with an external subset or external parameter
  5429.           entities with "standalone='no'", ...  ... The declaration
  5430.           of a parameter entity must precede any reference to it... 
  5431.           [ WFC: In DTD ] Parameter-entity references may only appear
  5432.           in the DTD. NOTE: misleading but this is handled.  A
  5433.           PEReference may have been detected in the current input
  5434.           stream the handling is done accordingly to
  5435.           http://www.w3.org/TR/REC-xml#entproc i.e. - Included in
  5436.           literal in entity values - Included as Parameter Entity
  5437.            reference within DTDs """
  5438.         libxml2mod.xmlParserHandlePEReference(self._o)
  5439.  
  5440.     def parserHandleReference(self):
  5441.         """TODO: Remove, now deprecated ... the test is done directly
  5442.           in the content parsing routines.  [67] Reference ::=
  5443.           EntityRef | CharRef  [68] EntityRef ::= '&' Name ';'  [
  5444.           WFC: Entity Declared ] the Name given in the entity
  5445.           reference must match that in an entity declaration, except
  5446.           that well-formed documents need not declare any of the
  5447.           following entities: amp, lt, gt, apos, quot.  [ WFC: Parsed
  5448.           Entity ] An entity reference must not contain the name of
  5449.           an unparsed entity  [66] CharRef ::= '&#' [0-9]+ ';' |
  5450.           '&#x' [0-9a-fA-F]+ ';'  A PEReference may have been
  5451.           detected in the current input stream the handling is done
  5452.            accordingly to http://www.w3.org/TR/REC-xml#entproc """
  5453.         libxml2mod.xmlParserHandleReference(self._o)
  5454.  
  5455.     def popInput(self):
  5456.         """xmlPopInput: the current input pointed by ctxt->input came
  5457.            to an end pop it and return the next char. """
  5458.         ret = libxml2mod.xmlPopInput(self._o)
  5459.         return ret
  5460.  
  5461.     def scanName(self):
  5462.         """Trickery: parse an XML name but without consuming the input
  5463.           flow Needed for rollback cases. Used only when parsing
  5464.           entities references.  TODO: seems deprecated now, only used
  5465.           in the default part of xmlParserHandleReference  [4]
  5466.           NameChar ::= Letter | Digit | '.' | '-' | '_' | ':' |
  5467.           CombiningChar | Extender  [5] Name ::= (Letter | '_' | ':')
  5468.            (NameChar)*  [6] Names ::= Name (S Name)* """
  5469.         ret = libxml2mod.xmlScanName(self._o)
  5470.         return ret
  5471.  
  5472.     def skipBlankChars(self):
  5473.         """skip all blanks character found at that point in the input
  5474.           streams. It pops up finished entities in the process if
  5475.            allowable at that point. """
  5476.         ret = libxml2mod.xmlSkipBlankChars(self._o)
  5477.         return ret
  5478.  
  5479.     def stringDecodeEntities(self, str, what, end, end2, end3):
  5480.         """Takes a entity string content and process to do the
  5481.           adequate substitutions.  [67] Reference ::= EntityRef |
  5482.            CharRef  [69] PEReference ::= '%' Name ';' """
  5483.         ret = libxml2mod.xmlStringDecodeEntities(self._o, str, what, end, end2, end3)
  5484.         return ret
  5485.  
  5486.     def stringLenDecodeEntities(self, str, len, what, end, end2, end3):
  5487.         """Takes a entity string content and process to do the
  5488.           adequate substitutions.  [67] Reference ::= EntityRef |
  5489.            CharRef  [69] PEReference ::= '%' Name ';' """
  5490.         ret = libxml2mod.xmlStringLenDecodeEntities(self._o, str, len, what, end, end2, end3)
  5491.         return ret
  5492.  
  5493. class xmlAttr(xmlNode):
  5494.     def __init__(self, _obj=None):
  5495.         if type(_obj).__name__ != 'PyCObject':
  5496.             raise TypeError, 'xmlAttr needs a PyCObject argument'
  5497.         self._o = _obj
  5498.         xmlNode.__init__(self, _obj=_obj)
  5499.  
  5500.     def __repr__(self):
  5501.         return "<xmlAttr (%s) object at 0x%x>" % (self.name, long(pos_id (self)))
  5502.  
  5503.     #
  5504.     # xmlAttr functions from module debugXML
  5505.     #
  5506.  
  5507.     def debugDumpAttr(self, output, depth):
  5508.         """Dumps debug information for the attribute """
  5509.         libxml2mod.xmlDebugDumpAttr(output, self._o, depth)
  5510.  
  5511.     def debugDumpAttrList(self, output, depth):
  5512.         """Dumps debug information for the attribute list """
  5513.         libxml2mod.xmlDebugDumpAttrList(output, self._o, depth)
  5514.  
  5515.     #
  5516.     # xmlAttr functions from module tree
  5517.     #
  5518.  
  5519.     def copyProp(self, target):
  5520.         """Do a copy of the attribute. """
  5521.         if target is None: target__o = None
  5522.         else: target__o = target._o
  5523.         ret = libxml2mod.xmlCopyProp(target__o, self._o)
  5524.         if ret is None:raise treeError('xmlCopyProp() failed')
  5525.         __tmp = xmlAttr(_obj=ret)
  5526.         return __tmp
  5527.  
  5528.     def copyPropList(self, target):
  5529.         """Do a copy of an attribute list. """
  5530.         if target is None: target__o = None
  5531.         else: target__o = target._o
  5532.         ret = libxml2mod.xmlCopyPropList(target__o, self._o)
  5533.         if ret is None:raise treeError('xmlCopyPropList() failed')
  5534.         __tmp = xmlAttr(_obj=ret)
  5535.         return __tmp
  5536.  
  5537.     def freeProp(self):
  5538.         """Free one attribute, all the content is freed too """
  5539.         libxml2mod.xmlFreeProp(self._o)
  5540.  
  5541.     def freePropList(self):
  5542.         """Free a property and all its siblings, all the children are
  5543.            freed too. """
  5544.         libxml2mod.xmlFreePropList(self._o)
  5545.  
  5546.     def removeProp(self):
  5547.         """Unlink and free one attribute, all the content is freed too
  5548.            Note this doesn't work for namespace definition attributes """
  5549.         ret = libxml2mod.xmlRemoveProp(self._o)
  5550.         return ret
  5551.  
  5552.     #
  5553.     # xmlAttr functions from module valid
  5554.     #
  5555.  
  5556.     def removeID(self, doc):
  5557.         """Remove the given attribute from the ID table maintained
  5558.            internally. """
  5559.         if doc is None: doc__o = None
  5560.         else: doc__o = doc._o
  5561.         ret = libxml2mod.xmlRemoveID(doc__o, self._o)
  5562.         return ret
  5563.  
  5564.     def removeRef(self, doc):
  5565.         """Remove the given attribute from the Ref table maintained
  5566.            internally. """
  5567.         if doc is None: doc__o = None
  5568.         else: doc__o = doc._o
  5569.         ret = libxml2mod.xmlRemoveRef(doc__o, self._o)
  5570.         return ret
  5571.  
  5572. class xmlAttribute(xmlNode):
  5573.     def __init__(self, _obj=None):
  5574.         if type(_obj).__name__ != 'PyCObject':
  5575.             raise TypeError, 'xmlAttribute needs a PyCObject argument'
  5576.         self._o = _obj
  5577.         xmlNode.__init__(self, _obj=_obj)
  5578.  
  5579.     def __repr__(self):
  5580.         return "<xmlAttribute (%s) object at 0x%x>" % (self.name, long(pos_id (self)))
  5581.  
  5582. class catalog:
  5583.     def __init__(self, _obj=None):
  5584.         if _obj != None:self._o = _obj;return
  5585.         self._o = None
  5586.  
  5587.     def __del__(self):
  5588.         if self._o != None:
  5589.             libxml2mod.xmlFreeCatalog(self._o)
  5590.         self._o = None
  5591.  
  5592.     #
  5593.     # catalog functions from module catalog
  5594.     #
  5595.  
  5596.     def add(self, type, orig, replace):
  5597.         """Add an entry in the catalog, it may overwrite existing but
  5598.            different entries. """
  5599.         ret = libxml2mod.xmlACatalogAdd(self._o, type, orig, replace)
  5600.         return ret
  5601.  
  5602.     def catalogIsEmpty(self):
  5603.         """Check is a catalog is empty """
  5604.         ret = libxml2mod.xmlCatalogIsEmpty(self._o)
  5605.         return ret
  5606.  
  5607.     def convertSGMLCatalog(self):
  5608.         """Convert all the SGML catalog entries as XML ones """
  5609.         ret = libxml2mod.xmlConvertSGMLCatalog(self._o)
  5610.         return ret
  5611.  
  5612.     def dump(self, out):
  5613.         """Dump the given catalog to the given file. """
  5614.         libxml2mod.xmlACatalogDump(self._o, out)
  5615.  
  5616.     def remove(self, value):
  5617.         """Remove an entry from the catalog """
  5618.         ret = libxml2mod.xmlACatalogRemove(self._o, value)
  5619.         return ret
  5620.  
  5621.     def resolve(self, pubID, sysID):
  5622.         """Do a complete resolution lookup of an External Identifier """
  5623.         ret = libxml2mod.xmlACatalogResolve(self._o, pubID, sysID)
  5624.         return ret
  5625.  
  5626.     def resolvePublic(self, pubID):
  5627.         """Try to lookup the catalog local reference associated to a
  5628.            public ID in that catalog """
  5629.         ret = libxml2mod.xmlACatalogResolvePublic(self._o, pubID)
  5630.         return ret
  5631.  
  5632.     def resolveSystem(self, sysID):
  5633.         """Try to lookup the catalog resource for a system ID """
  5634.         ret = libxml2mod.xmlACatalogResolveSystem(self._o, sysID)
  5635.         return ret
  5636.  
  5637.     def resolveURI(self, URI):
  5638.         """Do a complete resolution lookup of an URI """
  5639.         ret = libxml2mod.xmlACatalogResolveURI(self._o, URI)
  5640.         return ret
  5641.  
  5642. class xmlDtd(xmlNode):
  5643.     def __init__(self, _obj=None):
  5644.         if type(_obj).__name__ != 'PyCObject':
  5645.             raise TypeError, 'xmlDtd needs a PyCObject argument'
  5646.         self._o = _obj
  5647.         xmlNode.__init__(self, _obj=_obj)
  5648.  
  5649.     def __repr__(self):
  5650.         return "<xmlDtd (%s) object at 0x%x>" % (self.name, long(pos_id (self)))
  5651.  
  5652.     #
  5653.     # xmlDtd functions from module debugXML
  5654.     #
  5655.  
  5656.     def debugDumpDTD(self, output):
  5657.         """Dumps debug information for the DTD """
  5658.         libxml2mod.xmlDebugDumpDTD(output, self._o)
  5659.  
  5660.     #
  5661.     # xmlDtd functions from module tree
  5662.     #
  5663.  
  5664.     def copyDtd(self):
  5665.         """Do a copy of the dtd. """
  5666.         ret = libxml2mod.xmlCopyDtd(self._o)
  5667.         if ret is None:raise treeError('xmlCopyDtd() failed')
  5668.         __tmp = xmlDtd(_obj=ret)
  5669.         return __tmp
  5670.  
  5671.     def freeDtd(self):
  5672.         """Free a DTD structure. """
  5673.         libxml2mod.xmlFreeDtd(self._o)
  5674.  
  5675.     #
  5676.     # xmlDtd functions from module valid
  5677.     #
  5678.  
  5679.     def dtdAttrDesc(self, elem, name):
  5680.         """Search the DTD for the description of this attribute on
  5681.            this element. """
  5682.         ret = libxml2mod.xmlGetDtdAttrDesc(self._o, elem, name)
  5683.         if ret is None:raise treeError('xmlGetDtdAttrDesc() failed')
  5684.         __tmp = xmlAttribute(_obj=ret)
  5685.         return __tmp
  5686.  
  5687.     def dtdElementDesc(self, name):
  5688.         """Search the DTD for the description of this element """
  5689.         ret = libxml2mod.xmlGetDtdElementDesc(self._o, name)
  5690.         if ret is None:raise treeError('xmlGetDtdElementDesc() failed')
  5691.         __tmp = xmlElement(_obj=ret)
  5692.         return __tmp
  5693.  
  5694.     def dtdQAttrDesc(self, elem, name, prefix):
  5695.         """Search the DTD for the description of this qualified
  5696.            attribute on this element. """
  5697.         ret = libxml2mod.xmlGetDtdQAttrDesc(self._o, elem, name, prefix)
  5698.         if ret is None:raise treeError('xmlGetDtdQAttrDesc() failed')
  5699.         __tmp = xmlAttribute(_obj=ret)
  5700.         return __tmp
  5701.  
  5702.     def dtdQElementDesc(self, name, prefix):
  5703.         """Search the DTD for the description of this element """
  5704.         ret = libxml2mod.xmlGetDtdQElementDesc(self._o, name, prefix)
  5705.         if ret is None:raise treeError('xmlGetDtdQElementDesc() failed')
  5706.         __tmp = xmlElement(_obj=ret)
  5707.         return __tmp
  5708.  
  5709. class xmlElement(xmlNode):
  5710.     def __init__(self, _obj=None):
  5711.         if type(_obj).__name__ != 'PyCObject':
  5712.             raise TypeError, 'xmlElement needs a PyCObject argument'
  5713.         self._o = _obj
  5714.         xmlNode.__init__(self, _obj=_obj)
  5715.  
  5716.     def __repr__(self):
  5717.         return "<xmlElement (%s) object at 0x%x>" % (self.name, long(pos_id (self)))
  5718.  
  5719. class xmlEntity(xmlNode):
  5720.     def __init__(self, _obj=None):
  5721.         if type(_obj).__name__ != 'PyCObject':
  5722.             raise TypeError, 'xmlEntity needs a PyCObject argument'
  5723.         self._o = _obj
  5724.         xmlNode.__init__(self, _obj=_obj)
  5725.  
  5726.     def __repr__(self):
  5727.         return "<xmlEntity (%s) object at 0x%x>" % (self.name, long(pos_id (self)))
  5728.  
  5729.     #
  5730.     # xmlEntity functions from module parserInternals
  5731.     #
  5732.  
  5733.     def handleEntity(self, ctxt):
  5734.         """Default handling of defined entities, when should we define
  5735.           a new input stream ? When do we just handle that as a set
  5736.            of chars ?  OBSOLETE: to be removed at some point. """
  5737.         if ctxt is None: ctxt__o = None
  5738.         else: ctxt__o = ctxt._o
  5739.         libxml2mod.xmlHandleEntity(ctxt__o, self._o)
  5740.  
  5741. class Error:
  5742.     def __init__(self, _obj=None):
  5743.         if _obj != None:self._o = _obj;return
  5744.         self._o = None
  5745.  
  5746.     # accessors for Error
  5747.     def code(self):
  5748.         """The error code, e.g. an xmlParserError """
  5749.         ret = libxml2mod.xmlErrorGetCode(self._o)
  5750.         return ret
  5751.  
  5752.     def domain(self):
  5753.         """What part of the library raised this error """
  5754.         ret = libxml2mod.xmlErrorGetDomain(self._o)
  5755.         return ret
  5756.  
  5757.     def file(self):
  5758.         """the filename """
  5759.         ret = libxml2mod.xmlErrorGetFile(self._o)
  5760.         return ret
  5761.  
  5762.     def level(self):
  5763.         """how consequent is the error """
  5764.         ret = libxml2mod.xmlErrorGetLevel(self._o)
  5765.         return ret
  5766.  
  5767.     def line(self):
  5768.         """the line number if available """
  5769.         ret = libxml2mod.xmlErrorGetLine(self._o)
  5770.         return ret
  5771.  
  5772.     def message(self):
  5773.         """human-readable informative error message """
  5774.         ret = libxml2mod.xmlErrorGetMessage(self._o)
  5775.         return ret
  5776.  
  5777.     #
  5778.     # Error functions from module xmlerror
  5779.     #
  5780.  
  5781.     def copyError(self, to):
  5782.         """Save the original error to the new place. """
  5783.         if to is None: to__o = None
  5784.         else: to__o = to._o
  5785.         ret = libxml2mod.xmlCopyError(self._o, to__o)
  5786.         return ret
  5787.  
  5788.     def resetError(self):
  5789.         """Cleanup the error. """
  5790.         libxml2mod.xmlResetError(self._o)
  5791.  
  5792. class xmlNs(xmlNode):
  5793.     def __init__(self, _obj=None):
  5794.         if type(_obj).__name__ != 'PyCObject':
  5795.             raise TypeError, 'xmlNs needs a PyCObject argument'
  5796.         self._o = _obj
  5797.         xmlNode.__init__(self, _obj=_obj)
  5798.  
  5799.     def __repr__(self):
  5800.         return "<xmlNs (%s) object at 0x%x>" % (self.name, long(pos_id (self)))
  5801.  
  5802.     #
  5803.     # xmlNs functions from module tree
  5804.     #
  5805.  
  5806.     def copyNamespace(self):
  5807.         """Do a copy of the namespace. """
  5808.         ret = libxml2mod.xmlCopyNamespace(self._o)
  5809.         if ret is None:raise treeError('xmlCopyNamespace() failed')
  5810.         __tmp = xmlNs(_obj=ret)
  5811.         return __tmp
  5812.  
  5813.     def copyNamespaceList(self):
  5814.         """Do a copy of an namespace list. """
  5815.         ret = libxml2mod.xmlCopyNamespaceList(self._o)
  5816.         if ret is None:raise treeError('xmlCopyNamespaceList() failed')
  5817.         __tmp = xmlNs(_obj=ret)
  5818.         return __tmp
  5819.  
  5820.     def freeNs(self):
  5821.         """Free up the structures associated to a namespace """
  5822.         libxml2mod.xmlFreeNs(self._o)
  5823.  
  5824.     def freeNsList(self):
  5825.         """Free up all the structures associated to the chained
  5826.            namespaces. """
  5827.         libxml2mod.xmlFreeNsList(self._o)
  5828.  
  5829.     def newChild(self, parent, name, content):
  5830.         """Creation of a new child element, added at the end of
  5831.           @parent children list. @ns and @content parameters are
  5832.           optional (None). If @ns is None, the newly created element
  5833.           inherits the namespace of @parent. If @content is non None,
  5834.           a child list containing the TEXTs and ENTITY_REFs node will
  5835.           be created. NOTE: @content is supposed to be a piece of XML
  5836.           CDATA, so it allows entity references. XML special chars
  5837.           must be escaped first by using
  5838.           xmlEncodeEntitiesReentrant(), or xmlNewTextChild() should
  5839.            be used. """
  5840.         if parent is None: parent__o = None
  5841.         else: parent__o = parent._o
  5842.         ret = libxml2mod.xmlNewChild(parent__o, self._o, name, content)
  5843.         if ret is None:raise treeError('xmlNewChild() failed')
  5844.         __tmp = xmlNode(_obj=ret)
  5845.         return __tmp
  5846.  
  5847.     def newDocNode(self, doc, name, content):
  5848.         """Creation of a new node element within a document. @ns and
  5849.           @content are optional (None). NOTE: @content is supposed to
  5850.           be a piece of XML CDATA, so it allow entities references,
  5851.           but XML special chars need to be escaped first by using
  5852.           xmlEncodeEntitiesReentrant(). Use xmlNewDocRawNode() if you
  5853.            don't need entities support. """
  5854.         if doc is None: doc__o = None
  5855.         else: doc__o = doc._o
  5856.         ret = libxml2mod.xmlNewDocNode(doc__o, self._o, name, content)
  5857.         if ret is None:raise treeError('xmlNewDocNode() failed')
  5858.         __tmp = xmlNode(_obj=ret)
  5859.         return __tmp
  5860.  
  5861.     def newDocNodeEatName(self, doc, name, content):
  5862.         """Creation of a new node element within a document. @ns and
  5863.           @content are optional (None). NOTE: @content is supposed to
  5864.           be a piece of XML CDATA, so it allow entities references,
  5865.           but XML special chars need to be escaped first by using
  5866.           xmlEncodeEntitiesReentrant(). Use xmlNewDocRawNode() if you
  5867.            don't need entities support. """
  5868.         if doc is None: doc__o = None
  5869.         else: doc__o = doc._o
  5870.         ret = libxml2mod.xmlNewDocNodeEatName(doc__o, self._o, name, content)
  5871.         if ret is None:raise treeError('xmlNewDocNodeEatName() failed')
  5872.         __tmp = xmlNode(_obj=ret)
  5873.         return __tmp
  5874.  
  5875.     def newDocRawNode(self, doc, name, content):
  5876.         """Creation of a new node element within a document. @ns and
  5877.            @content are optional (None). """
  5878.         if doc is None: doc__o = None
  5879.         else: doc__o = doc._o
  5880.         ret = libxml2mod.xmlNewDocRawNode(doc__o, self._o, name, content)
  5881.         if ret is None:raise treeError('xmlNewDocRawNode() failed')
  5882.         __tmp = xmlNode(_obj=ret)
  5883.         return __tmp
  5884.  
  5885.     def newNodeEatName(self, name):
  5886.         """Creation of a new node element. @ns is optional (None). """
  5887.         ret = libxml2mod.xmlNewNodeEatName(self._o, name)
  5888.         if ret is None:raise treeError('xmlNewNodeEatName() failed')
  5889.         __tmp = xmlNode(_obj=ret)
  5890.         return __tmp
  5891.  
  5892.     def newNsProp(self, node, name, value):
  5893.         """Create a new property tagged with a namespace and carried
  5894.            by a node. """
  5895.         if node is None: node__o = None
  5896.         else: node__o = node._o
  5897.         ret = libxml2mod.xmlNewNsProp(node__o, self._o, name, value)
  5898.         if ret is None:raise treeError('xmlNewNsProp() failed')
  5899.         __tmp = xmlAttr(_obj=ret)
  5900.         return __tmp
  5901.  
  5902.     def newNsPropEatName(self, node, name, value):
  5903.         """Create a new property tagged with a namespace and carried
  5904.            by a node. """
  5905.         if node is None: node__o = None
  5906.         else: node__o = node._o
  5907.         ret = libxml2mod.xmlNewNsPropEatName(node__o, self._o, name, value)
  5908.         if ret is None:raise treeError('xmlNewNsPropEatName() failed')
  5909.         __tmp = xmlAttr(_obj=ret)
  5910.         return __tmp
  5911.  
  5912.     def newTextChild(self, parent, name, content):
  5913.         """Creation of a new child element, added at the end of
  5914.           @parent children list. @ns and @content parameters are
  5915.           optional (None). If @ns is None, the newly created element
  5916.           inherits the namespace of @parent. If @content is non None,
  5917.           a child TEXT node will be created containing the string
  5918.           @content. NOTE: Use xmlNewChild() if @content will contain
  5919.           entities that need to be preserved. Use this function,
  5920.           xmlNewTextChild(), if you need to ensure that reserved XML
  5921.           chars that might appear in @content, such as the ampersand,
  5922.           greater-than or less-than signs, are automatically replaced
  5923.            by their XML escaped entity representations. """
  5924.         if parent is None: parent__o = None
  5925.         else: parent__o = parent._o
  5926.         ret = libxml2mod.xmlNewTextChild(parent__o, self._o, name, content)
  5927.         if ret is None:raise treeError('xmlNewTextChild() failed')
  5928.         __tmp = xmlNode(_obj=ret)
  5929.         return __tmp
  5930.  
  5931.     def setNs(self, node):
  5932.         """Associate a namespace to a node, a posteriori. """
  5933.         if node is None: node__o = None
  5934.         else: node__o = node._o
  5935.         libxml2mod.xmlSetNs(node__o, self._o)
  5936.  
  5937.     def setNsProp(self, node, name, value):
  5938.         """Set (or reset) an attribute carried by a node. The ns
  5939.            structure must be in scope, this is not checked """
  5940.         if node is None: node__o = None
  5941.         else: node__o = node._o
  5942.         ret = libxml2mod.xmlSetNsProp(node__o, self._o, name, value)
  5943.         if ret is None:raise treeError('xmlSetNsProp() failed')
  5944.         __tmp = xmlAttr(_obj=ret)
  5945.         return __tmp
  5946.  
  5947.     def unsetNsProp(self, node, name):
  5948.         """Remove an attribute carried by a node. """
  5949.         if node is None: node__o = None
  5950.         else: node__o = node._o
  5951.         ret = libxml2mod.xmlUnsetNsProp(node__o, self._o, name)
  5952.         return ret
  5953.  
  5954.     #
  5955.     # xmlNs functions from module xpathInternals
  5956.     #
  5957.  
  5958.     def xpathNodeSetFreeNs(self):
  5959.         """Namespace nodes in libxml don't match the XPath semantic.
  5960.           In a node set the namespace nodes are duplicated and the
  5961.           next pointer is set to the parent node in the XPath
  5962.            semantic. Check if such a node needs to be freed """
  5963.         libxml2mod.xmlXPathNodeSetFreeNs(self._o)
  5964.  
  5965. class outputBuffer(ioWriteWrapper):
  5966.     def __init__(self, _obj=None):
  5967.         self._o = _obj
  5968.         ioWriteWrapper.__init__(self, _obj=_obj)
  5969.  
  5970.     #
  5971.     # outputBuffer functions from module HTMLtree
  5972.     #
  5973.  
  5974.     def htmlDocContentDumpFormatOutput(self, cur, encoding, format):
  5975.         """Dump an HTML document. """
  5976.         if cur is None: cur__o = None
  5977.         else: cur__o = cur._o
  5978.         libxml2mod.htmlDocContentDumpFormatOutput(self._o, cur__o, encoding, format)
  5979.  
  5980.     def htmlDocContentDumpOutput(self, cur, encoding):
  5981.         """Dump an HTML document. Formating return/spaces are added. """
  5982.         if cur is None: cur__o = None
  5983.         else: cur__o = cur._o
  5984.         libxml2mod.htmlDocContentDumpOutput(self._o, cur__o, encoding)
  5985.  
  5986.     def htmlNodeDumpFormatOutput(self, doc, cur, encoding, format):
  5987.         """Dump an HTML node, recursive behaviour,children are printed
  5988.            too. """
  5989.         if doc is None: doc__o = None
  5990.         else: doc__o = doc._o
  5991.         if cur is None: cur__o = None
  5992.         else: cur__o = cur._o
  5993.         libxml2mod.htmlNodeDumpFormatOutput(self._o, doc__o, cur__o, encoding, format)
  5994.  
  5995.     def htmlNodeDumpOutput(self, doc, cur, encoding):
  5996.         """Dump an HTML node, recursive behaviour,children are printed
  5997.            too, and formatting returns/spaces are added. """
  5998.         if doc is None: doc__o = None
  5999.         else: doc__o = doc._o
  6000.         if cur is None: cur__o = None
  6001.         else: cur__o = cur._o
  6002.         libxml2mod.htmlNodeDumpOutput(self._o, doc__o, cur__o, encoding)
  6003.  
  6004.     #
  6005.     # outputBuffer functions from module tree
  6006.     #
  6007.  
  6008.     def nodeDumpOutput(self, doc, cur, level, format, encoding):
  6009.         """Dump an XML node, recursive behaviour, children are printed
  6010.           too. Note that @format = 1 provide node indenting only if
  6011.           xmlIndentTreeOutput = 1 or xmlKeepBlanksDefault(0) was
  6012.            called """
  6013.         if doc is None: doc__o = None
  6014.         else: doc__o = doc._o
  6015.         if cur is None: cur__o = None
  6016.         else: cur__o = cur._o
  6017.         libxml2mod.xmlNodeDumpOutput(self._o, doc__o, cur__o, level, format, encoding)
  6018.  
  6019.     def saveFileTo(self, cur, encoding):
  6020.         """Dump an XML document to an I/O buffer. Warning ! This call
  6021.           xmlOutputBufferClose() on buf which is not available after
  6022.            this call. """
  6023.         if cur is None: cur__o = None
  6024.         else: cur__o = cur._o
  6025.         ret = libxml2mod.xmlSaveFileTo(self._o, cur__o, encoding)
  6026.         return ret
  6027.  
  6028.     def saveFormatFileTo(self, cur, encoding, format):
  6029.         """Dump an XML document to an I/O buffer. Warning ! This call
  6030.           xmlOutputBufferClose() on buf which is not available after
  6031.            this call. """
  6032.         if cur is None: cur__o = None
  6033.         else: cur__o = cur._o
  6034.         ret = libxml2mod.xmlSaveFormatFileTo(self._o, cur__o, encoding, format)
  6035.         return ret
  6036.  
  6037.     #
  6038.     # outputBuffer functions from module xmlIO
  6039.     #
  6040.  
  6041.     def write(self, len, buf):
  6042.         """Write the content of the array in the output I/O buffer
  6043.           This routine handle the I18N transcoding from internal
  6044.           UTF-8 The buffer is lossless, i.e. will store in case of
  6045.            partial or delayed writes. """
  6046.         ret = libxml2mod.xmlOutputBufferWrite(self._o, len, buf)
  6047.         return ret
  6048.  
  6049.     def writeString(self, str):
  6050.         """Write the content of the string in the output I/O buffer
  6051.           This routine handle the I18N transcoding from internal
  6052.           UTF-8 The buffer is lossless, i.e. will store in case of
  6053.            partial or delayed writes. """
  6054.         ret = libxml2mod.xmlOutputBufferWriteString(self._o, str)
  6055.         return ret
  6056.  
  6057. class inputBuffer(ioReadWrapper):
  6058.     def __init__(self, _obj=None):
  6059.         self._o = _obj
  6060.         ioReadWrapper.__init__(self, _obj=_obj)
  6061.  
  6062.     def __del__(self):
  6063.         if self._o != None:
  6064.             libxml2mod.xmlFreeParserInputBuffer(self._o)
  6065.         self._o = None
  6066.  
  6067.     #
  6068.     # inputBuffer functions from module xmlIO
  6069.     #
  6070.  
  6071.     def grow(self, len):
  6072.         """Grow up the content of the input buffer, the old data are
  6073.           preserved This routine handle the I18N transcoding to
  6074.           internal UTF-8 This routine is used when operating the
  6075.           parser in normal (pull) mode  TODO: one should be able to
  6076.           remove one extra copy by copying directly onto in->buffer
  6077.            or in->raw """
  6078.         ret = libxml2mod.xmlParserInputBufferGrow(self._o, len)
  6079.         return ret
  6080.  
  6081.     def push(self, len, buf):
  6082.         """Push the content of the arry in the input buffer This
  6083.           routine handle the I18N transcoding to internal UTF-8 This
  6084.           is used when operating the parser in progressive (push)
  6085.            mode. """
  6086.         ret = libxml2mod.xmlParserInputBufferPush(self._o, len, buf)
  6087.         return ret
  6088.  
  6089.     def read(self, len):
  6090.         """Refresh the content of the input buffer, the old data are
  6091.           considered consumed This routine handle the I18N
  6092.            transcoding to internal UTF-8 """
  6093.         ret = libxml2mod.xmlParserInputBufferRead(self._o, len)
  6094.         return ret
  6095.  
  6096.     #
  6097.     # inputBuffer functions from module xmlreader
  6098.     #
  6099.  
  6100.     def Setup(self, reader, URL, encoding, options):
  6101.         """Setup an XML reader with new options """
  6102.         if reader is None: reader__o = None
  6103.         else: reader__o = reader._o
  6104.         ret = libxml2mod.xmlTextReaderSetup(reader__o, self._o, URL, encoding, options)
  6105.         return ret
  6106.  
  6107.     def newTextReader(self, URI):
  6108.         """Create an xmlTextReader structure fed with @input """
  6109.         ret = libxml2mod.xmlNewTextReader(self._o, URI)
  6110.         if ret is None:raise treeError('xmlNewTextReader() failed')
  6111.         __tmp = xmlTextReader(_obj=ret)
  6112.         __tmp.input = self
  6113.         return __tmp
  6114.  
  6115. class xmlReg:
  6116.     def __init__(self, _obj=None):
  6117.         if _obj != None:self._o = _obj;return
  6118.         self._o = None
  6119.  
  6120.     def __del__(self):
  6121.         if self._o != None:
  6122.             libxml2mod.xmlRegFreeRegexp(self._o)
  6123.         self._o = None
  6124.  
  6125.     #
  6126.     # xmlReg functions from module xmlregexp
  6127.     #
  6128.  
  6129.     def regexpExec(self, content):
  6130.         """Check if the regular expression generates the value """
  6131.         ret = libxml2mod.xmlRegexpExec(self._o, content)
  6132.         return ret
  6133.  
  6134.     def regexpIsDeterminist(self):
  6135.         """Check if the regular expression is determinist """
  6136.         ret = libxml2mod.xmlRegexpIsDeterminist(self._o)
  6137.         return ret
  6138.  
  6139.     def regexpPrint(self, output):
  6140.         """Print the content of the compiled regular expression """
  6141.         libxml2mod.xmlRegexpPrint(output, self._o)
  6142.  
  6143. class relaxNgParserCtxt:
  6144.     def __init__(self, _obj=None):
  6145.         if _obj != None:self._o = _obj;return
  6146.         self._o = None
  6147.  
  6148.     def __del__(self):
  6149.         if self._o != None:
  6150.             libxml2mod.xmlRelaxNGFreeParserCtxt(self._o)
  6151.         self._o = None
  6152.  
  6153.     #
  6154.     # relaxNgParserCtxt functions from module relaxng
  6155.     #
  6156.  
  6157.     def relaxNGParse(self):
  6158.         """parse a schema definition resource and build an internal
  6159.            XML Shema struture which can be used to validate instances. """
  6160.         ret = libxml2mod.xmlRelaxNGParse(self._o)
  6161.         if ret is None:raise parserError('xmlRelaxNGParse() failed')
  6162.         __tmp = relaxNgSchema(_obj=ret)
  6163.         return __tmp
  6164.  
  6165.     def relaxParserSetFlag(self, flags):
  6166.         """Semi private function used to pass informations to a parser
  6167.            context which are a combination of xmlRelaxNGParserFlag . """
  6168.         ret = libxml2mod.xmlRelaxParserSetFlag(self._o, flags)
  6169.         return ret
  6170.  
  6171. class relaxNgSchema:
  6172.     def __init__(self, _obj=None):
  6173.         if _obj != None:self._o = _obj;return
  6174.         self._o = None
  6175.  
  6176.     def __del__(self):
  6177.         if self._o != None:
  6178.             libxml2mod.xmlRelaxNGFree(self._o)
  6179.         self._o = None
  6180.  
  6181.     #
  6182.     # relaxNgSchema functions from module relaxng
  6183.     #
  6184.  
  6185.     def relaxNGDump(self, output):
  6186.         """Dump a RelaxNG structure back """
  6187.         libxml2mod.xmlRelaxNGDump(output, self._o)
  6188.  
  6189.     def relaxNGDumpTree(self, output):
  6190.         """Dump the transformed RelaxNG tree. """
  6191.         libxml2mod.xmlRelaxNGDumpTree(output, self._o)
  6192.  
  6193.     def relaxNGNewValidCtxt(self):
  6194.         """Create an XML RelaxNGs validation context based on the
  6195.            given schema """
  6196.         ret = libxml2mod.xmlRelaxNGNewValidCtxt(self._o)
  6197.         if ret is None:raise treeError('xmlRelaxNGNewValidCtxt() failed')
  6198.         __tmp = relaxNgValidCtxt(_obj=ret)
  6199.         __tmp.schema = self
  6200.         return __tmp
  6201.  
  6202.     #
  6203.     # relaxNgSchema functions from module xmlreader
  6204.     #
  6205.  
  6206.     def RelaxNGSetSchema(self, reader):
  6207.         """Use RelaxNG to validate the document as it is processed.
  6208.           Activation is only possible before the first Read(). if
  6209.           @schema is None, then RelaxNG validation is desactivated. @
  6210.           The @schema should not be freed until the reader is
  6211.            deallocated or its use has been deactivated. """
  6212.         if reader is None: reader__o = None
  6213.         else: reader__o = reader._o
  6214.         ret = libxml2mod.xmlTextReaderRelaxNGSetSchema(reader__o, self._o)
  6215.         return ret
  6216.  
  6217. class relaxNgValidCtxt(relaxNgValidCtxtCore):
  6218.     def __init__(self, _obj=None):
  6219.         self.schema = None
  6220.         self._o = _obj
  6221.         relaxNgValidCtxtCore.__init__(self, _obj=_obj)
  6222.  
  6223.     def __del__(self):
  6224.         if self._o != None:
  6225.             libxml2mod.xmlRelaxNGFreeValidCtxt(self._o)
  6226.         self._o = None
  6227.  
  6228.     #
  6229.     # relaxNgValidCtxt functions from module relaxng
  6230.     #
  6231.  
  6232.     def relaxNGValidateDoc(self, doc):
  6233.         """Validate a document tree in memory. """
  6234.         if doc is None: doc__o = None
  6235.         else: doc__o = doc._o
  6236.         ret = libxml2mod.xmlRelaxNGValidateDoc(self._o, doc__o)
  6237.         return ret
  6238.  
  6239.     def relaxNGValidateFullElement(self, doc, elem):
  6240.         """Validate a full subtree when
  6241.           xmlRelaxNGValidatePushElement() returned 0 and the content
  6242.            of the node has been expanded. """
  6243.         if doc is None: doc__o = None
  6244.         else: doc__o = doc._o
  6245.         if elem is None: elem__o = None
  6246.         else: elem__o = elem._o
  6247.         ret = libxml2mod.xmlRelaxNGValidateFullElement(self._o, doc__o, elem__o)
  6248.         return ret
  6249.  
  6250.     def relaxNGValidatePopElement(self, doc, elem):
  6251.         """Pop the element end from the RelaxNG validation stack. """
  6252.         if doc is None: doc__o = None
  6253.         else: doc__o = doc._o
  6254.         if elem is None: elem__o = None
  6255.         else: elem__o = elem._o
  6256.         ret = libxml2mod.xmlRelaxNGValidatePopElement(self._o, doc__o, elem__o)
  6257.         return ret
  6258.  
  6259.     def relaxNGValidatePushCData(self, data, len):
  6260.         """check the CData parsed for validation in the current stack """
  6261.         ret = libxml2mod.xmlRelaxNGValidatePushCData(self._o, data, len)
  6262.         return ret
  6263.  
  6264.     def relaxNGValidatePushElement(self, doc, elem):
  6265.         """Push a new element start on the RelaxNG validation stack. """
  6266.         if doc is None: doc__o = None
  6267.         else: doc__o = doc._o
  6268.         if elem is None: elem__o = None
  6269.         else: elem__o = elem._o
  6270.         ret = libxml2mod.xmlRelaxNGValidatePushElement(self._o, doc__o, elem__o)
  6271.         return ret
  6272.  
  6273. class SchemaParserCtxt:
  6274.     def __init__(self, _obj=None):
  6275.         if _obj != None:self._o = _obj;return
  6276.         self._o = None
  6277.  
  6278.     def __del__(self):
  6279.         if self._o != None:
  6280.             libxml2mod.xmlSchemaFreeParserCtxt(self._o)
  6281.         self._o = None
  6282.  
  6283.     #
  6284.     # SchemaParserCtxt functions from module xmlschemas
  6285.     #
  6286.  
  6287.     def schemaParse(self):
  6288.         """parse a schema definition resource and build an internal
  6289.            XML Shema struture which can be used to validate instances. """
  6290.         ret = libxml2mod.xmlSchemaParse(self._o)
  6291.         if ret is None:raise parserError('xmlSchemaParse() failed')
  6292.         __tmp = Schema(_obj=ret)
  6293.         return __tmp
  6294.  
  6295. class Schema:
  6296.     def __init__(self, _obj=None):
  6297.         if _obj != None:self._o = _obj;return
  6298.         self._o = None
  6299.  
  6300.     def __del__(self):
  6301.         if self._o != None:
  6302.             libxml2mod.xmlSchemaFree(self._o)
  6303.         self._o = None
  6304.  
  6305.     #
  6306.     # Schema functions from module xmlreader
  6307.     #
  6308.  
  6309.     def SetSchema(self, reader):
  6310.         """Use XSD Schema to validate the document as it is processed.
  6311.           Activation is only possible before the first Read(). if
  6312.           @schema is None, then Schema validation is desactivated. @
  6313.           The @schema should not be freed until the reader is
  6314.            deallocated or its use has been deactivated. """
  6315.         if reader is None: reader__o = None
  6316.         else: reader__o = reader._o
  6317.         ret = libxml2mod.xmlTextReaderSetSchema(reader__o, self._o)
  6318.         return ret
  6319.  
  6320.     #
  6321.     # Schema functions from module xmlschemas
  6322.     #
  6323.  
  6324.     def schemaDump(self, output):
  6325.         """Dump a Schema structure. """
  6326.         libxml2mod.xmlSchemaDump(output, self._o)
  6327.  
  6328.     def schemaNewValidCtxt(self):
  6329.         """Create an XML Schemas validation context based on the given
  6330.            schema. """
  6331.         ret = libxml2mod.xmlSchemaNewValidCtxt(self._o)
  6332.         if ret is None:raise treeError('xmlSchemaNewValidCtxt() failed')
  6333.         __tmp = SchemaValidCtxt(_obj=ret)
  6334.         __tmp.schema = self
  6335.         return __tmp
  6336.  
  6337. class SchemaValidCtxt(SchemaValidCtxtCore):
  6338.     def __init__(self, _obj=None):
  6339.         self.schema = None
  6340.         self._o = _obj
  6341.         SchemaValidCtxtCore.__init__(self, _obj=_obj)
  6342.  
  6343.     def __del__(self):
  6344.         if self._o != None:
  6345.             libxml2mod.xmlSchemaFreeValidCtxt(self._o)
  6346.         self._o = None
  6347.  
  6348.     #
  6349.     # SchemaValidCtxt functions from module xmlreader
  6350.     #
  6351.  
  6352.     def SchemaValidateCtxt(self, reader, options):
  6353.         """Use W3C XSD schema context to validate the document as it
  6354.           is processed. Activation is only possible before the first
  6355.           Read(). If @ctxt is None, then XML Schema validation is
  6356.            deactivated. """
  6357.         if reader is None: reader__o = None
  6358.         else: reader__o = reader._o
  6359.         ret = libxml2mod.xmlTextReaderSchemaValidateCtxt(reader__o, self._o, options)
  6360.         return ret
  6361.  
  6362.     #
  6363.     # SchemaValidCtxt functions from module xmlschemas
  6364.     #
  6365.  
  6366.     def schemaIsValid(self):
  6367.         """Check if any error was detected during validation. """
  6368.         ret = libxml2mod.xmlSchemaIsValid(self._o)
  6369.         return ret
  6370.  
  6371.     def schemaSetValidOptions(self, options):
  6372.         """Sets the options to be used during the validation. """
  6373.         ret = libxml2mod.xmlSchemaSetValidOptions(self._o, options)
  6374.         return ret
  6375.  
  6376.     def schemaValidCtxtGetOptions(self):
  6377.         """Get the validation context options. """
  6378.         ret = libxml2mod.xmlSchemaValidCtxtGetOptions(self._o)
  6379.         return ret
  6380.  
  6381.     def schemaValidCtxtGetParserCtxt(self):
  6382.         """allow access to the parser context of the schema validation
  6383.            context """
  6384.         ret = libxml2mod.xmlSchemaValidCtxtGetParserCtxt(self._o)
  6385.         if ret is None:raise parserError('xmlSchemaValidCtxtGetParserCtxt() failed')
  6386.         __tmp = parserCtxt(_obj=ret)
  6387.         return __tmp
  6388.  
  6389.     def schemaValidateDoc(self, doc):
  6390.         """Validate a document tree in memory. """
  6391.         if doc is None: doc__o = None
  6392.         else: doc__o = doc._o
  6393.         ret = libxml2mod.xmlSchemaValidateDoc(self._o, doc__o)
  6394.         return ret
  6395.  
  6396.     def schemaValidateFile(self, filename, options):
  6397.         """Do a schemas validation of the given resource, it will use
  6398.            the SAX streamable validation internally. """
  6399.         ret = libxml2mod.xmlSchemaValidateFile(self._o, filename, options)
  6400.         return ret
  6401.  
  6402.     def schemaValidateOneElement(self, elem):
  6403.         """Validate a branch of a tree, starting with the given @elem. """
  6404.         if elem is None: elem__o = None
  6405.         else: elem__o = elem._o
  6406.         ret = libxml2mod.xmlSchemaValidateOneElement(self._o, elem__o)
  6407.         return ret
  6408.  
  6409. class xmlTextReaderLocator:
  6410.     def __init__(self, _obj=None):
  6411.         if _obj != None:self._o = _obj;return
  6412.         self._o = None
  6413.  
  6414.     #
  6415.     # xmlTextReaderLocator functions from module xmlreader
  6416.     #
  6417.  
  6418.     def BaseURI(self):
  6419.         """Obtain the base URI for the given locator. """
  6420.         ret = libxml2mod.xmlTextReaderLocatorBaseURI(self._o)
  6421.         return ret
  6422.  
  6423.     def LineNumber(self):
  6424.         """Obtain the line number for the given locator. """
  6425.         ret = libxml2mod.xmlTextReaderLocatorLineNumber(self._o)
  6426.         return ret
  6427.  
  6428. class xmlTextReader(xmlTextReaderCore):
  6429.     def __init__(self, _obj=None):
  6430.         self.input = None
  6431.         self._o = _obj
  6432.         xmlTextReaderCore.__init__(self, _obj=_obj)
  6433.  
  6434.     def __del__(self):
  6435.         if self._o != None:
  6436.             libxml2mod.xmlFreeTextReader(self._o)
  6437.         self._o = None
  6438.  
  6439.     #
  6440.     # xmlTextReader functions from module xmlreader
  6441.     #
  6442.  
  6443.     def AttributeCount(self):
  6444.         """Provides the number of attributes of the current node """
  6445.         ret = libxml2mod.xmlTextReaderAttributeCount(self._o)
  6446.         return ret
  6447.  
  6448.     def BaseUri(self):
  6449.         """The base URI of the node. """
  6450.         ret = libxml2mod.xmlTextReaderConstBaseUri(self._o)
  6451.         return ret
  6452.  
  6453.     def ByteConsumed(self):
  6454.         """This function provides the current index of the parser used
  6455.           by the reader, relative to the start of the current entity.
  6456.           This function actually just wraps a call to
  6457.           xmlBytesConsumed() for the parser context associated with
  6458.            the reader. See xmlBytesConsumed() for more information. """
  6459.         ret = libxml2mod.xmlTextReaderByteConsumed(self._o)
  6460.         return ret
  6461.  
  6462.     def Close(self):
  6463.         """This method releases any resources allocated by the current
  6464.           instance changes the state to Closed and close any
  6465.            underlying input. """
  6466.         ret = libxml2mod.xmlTextReaderClose(self._o)
  6467.         return ret
  6468.  
  6469.     def CurrentDoc(self):
  6470.         """Hacking interface allowing to get the xmlDocPtr
  6471.           correponding to the current document being accessed by the
  6472.           xmlTextReader. NOTE: as a result of this call, the reader
  6473.           will not destroy the associated XML document and calling
  6474.           xmlFreeDoc() on the result is needed once the reader
  6475.            parsing has finished. """
  6476.         ret = libxml2mod.xmlTextReaderCurrentDoc(self._o)
  6477.         if ret is None:raise treeError('xmlTextReaderCurrentDoc() failed')
  6478.         __tmp = xmlDoc(_obj=ret)
  6479.         return __tmp
  6480.  
  6481.     def CurrentNode(self):
  6482.         """Hacking interface allowing to get the xmlNodePtr
  6483.           correponding to the current node being accessed by the
  6484.           xmlTextReader. This is dangerous because the underlying
  6485.            node may be destroyed on the next Reads. """
  6486.         ret = libxml2mod.xmlTextReaderCurrentNode(self._o)
  6487.         if ret is None:raise treeError('xmlTextReaderCurrentNode() failed')
  6488.         __tmp = xmlNode(_obj=ret)
  6489.         return __tmp
  6490.  
  6491.     def Depth(self):
  6492.         """The depth of the node in the tree. """
  6493.         ret = libxml2mod.xmlTextReaderDepth(self._o)
  6494.         return ret
  6495.  
  6496.     def Encoding(self):
  6497.         """Determine the encoding of the document being read. """
  6498.         ret = libxml2mod.xmlTextReaderConstEncoding(self._o)
  6499.         return ret
  6500.  
  6501.     def Expand(self):
  6502.         """Reads the contents of the current node and the full
  6503.           subtree. It then makes the subtree available until the next
  6504.            xmlTextReaderRead() call """
  6505.         ret = libxml2mod.xmlTextReaderExpand(self._o)
  6506.         if ret is None:raise treeError('xmlTextReaderExpand() failed')
  6507.         __tmp = xmlNode(_obj=ret)
  6508.         return __tmp
  6509.  
  6510.     def GetAttribute(self, name):
  6511.         """Provides the value of the attribute with the specified
  6512.            qualified name. """
  6513.         ret = libxml2mod.xmlTextReaderGetAttribute(self._o, name)
  6514.         return ret
  6515.  
  6516.     def GetAttributeNo(self, no):
  6517.         """Provides the value of the attribute with the specified
  6518.            index relative to the containing element. """
  6519.         ret = libxml2mod.xmlTextReaderGetAttributeNo(self._o, no)
  6520.         return ret
  6521.  
  6522.     def GetAttributeNs(self, localName, namespaceURI):
  6523.         """Provides the value of the specified attribute """
  6524.         ret = libxml2mod.xmlTextReaderGetAttributeNs(self._o, localName, namespaceURI)
  6525.         return ret
  6526.  
  6527.     def GetParserColumnNumber(self):
  6528.         """Provide the column number of the current parsing point. """
  6529.         ret = libxml2mod.xmlTextReaderGetParserColumnNumber(self._o)
  6530.         return ret
  6531.  
  6532.     def GetParserLineNumber(self):
  6533.         """Provide the line number of the current parsing point. """
  6534.         ret = libxml2mod.xmlTextReaderGetParserLineNumber(self._o)
  6535.         return ret
  6536.  
  6537.     def GetParserProp(self, prop):
  6538.         """Read the parser internal property. """
  6539.         ret = libxml2mod.xmlTextReaderGetParserProp(self._o, prop)
  6540.         return ret
  6541.  
  6542.     def GetRemainder(self):
  6543.         """Method to get the remainder of the buffered XML. this
  6544.           method stops the parser, set its state to End Of File and
  6545.           return the input stream with what is left that the parser
  6546.           did not use.  The implementation is not good, the parser
  6547.           certainly procgressed past what's left in reader->input,
  6548.           and there is an allocation problem. Best would be to
  6549.            rewrite it differently. """
  6550.         ret = libxml2mod.xmlTextReaderGetRemainder(self._o)
  6551.         if ret is None:raise treeError('xmlTextReaderGetRemainder() failed')
  6552.         __tmp = inputBuffer(_obj=ret)
  6553.         return __tmp
  6554.  
  6555.     def HasAttributes(self):
  6556.         """Whether the node has attributes. """
  6557.         ret = libxml2mod.xmlTextReaderHasAttributes(self._o)
  6558.         return ret
  6559.  
  6560.     def HasValue(self):
  6561.         """Whether the node can have a text value. """
  6562.         ret = libxml2mod.xmlTextReaderHasValue(self._o)
  6563.         return ret
  6564.  
  6565.     def IsDefault(self):
  6566.         """Whether an Attribute  node was generated from the default
  6567.            value defined in the DTD or schema. """
  6568.         ret = libxml2mod.xmlTextReaderIsDefault(self._o)
  6569.         return ret
  6570.  
  6571.     def IsEmptyElement(self):
  6572.         """Check if the current node is empty """
  6573.         ret = libxml2mod.xmlTextReaderIsEmptyElement(self._o)
  6574.         return ret
  6575.  
  6576.     def IsNamespaceDecl(self):
  6577.         """Determine whether the current node is a namespace
  6578.            declaration rather than a regular attribute. """
  6579.         ret = libxml2mod.xmlTextReaderIsNamespaceDecl(self._o)
  6580.         return ret
  6581.  
  6582.     def IsValid(self):
  6583.         """Retrieve the validity status from the parser context """
  6584.         ret = libxml2mod.xmlTextReaderIsValid(self._o)
  6585.         return ret
  6586.  
  6587.     def LocalName(self):
  6588.         """The local name of the node. """
  6589.         ret = libxml2mod.xmlTextReaderConstLocalName(self._o)
  6590.         return ret
  6591.  
  6592.     def LookupNamespace(self, prefix):
  6593.         """Resolves a namespace prefix in the scope of the current
  6594.            element. """
  6595.         ret = libxml2mod.xmlTextReaderLookupNamespace(self._o, prefix)
  6596.         return ret
  6597.  
  6598.     def MoveToAttribute(self, name):
  6599.         """Moves the position of the current instance to the attribute
  6600.            with the specified qualified name. """
  6601.         ret = libxml2mod.xmlTextReaderMoveToAttribute(self._o, name)
  6602.         return ret
  6603.  
  6604.     def MoveToAttributeNo(self, no):
  6605.         """Moves the position of the current instance to the attribute
  6606.           with the specified index relative to the containing element. """
  6607.         ret = libxml2mod.xmlTextReaderMoveToAttributeNo(self._o, no)
  6608.         return ret
  6609.  
  6610.     def MoveToAttributeNs(self, localName, namespaceURI):
  6611.         """Moves the position of the current instance to the attribute
  6612.            with the specified local name and namespace URI. """
  6613.         ret = libxml2mod.xmlTextReaderMoveToAttributeNs(self._o, localName, namespaceURI)
  6614.         return ret
  6615.  
  6616.     def MoveToElement(self):
  6617.         """Moves the position of the current instance to the node that
  6618.            contains the current Attribute  node. """
  6619.         ret = libxml2mod.xmlTextReaderMoveToElement(self._o)
  6620.         return ret
  6621.  
  6622.     def MoveToFirstAttribute(self):
  6623.         """Moves the position of the current instance to the first
  6624.            attribute associated with the current node. """
  6625.         ret = libxml2mod.xmlTextReaderMoveToFirstAttribute(self._o)
  6626.         return ret
  6627.  
  6628.     def MoveToNextAttribute(self):
  6629.         """Moves the position of the current instance to the next
  6630.            attribute associated with the current node. """
  6631.         ret = libxml2mod.xmlTextReaderMoveToNextAttribute(self._o)
  6632.         return ret
  6633.  
  6634.     def Name(self):
  6635.         """The qualified name of the node, equal to Prefix :LocalName. """
  6636.         ret = libxml2mod.xmlTextReaderConstName(self._o)
  6637.         return ret
  6638.  
  6639.     def NamespaceUri(self):
  6640.         """The URI defining the namespace associated with the node. """
  6641.         ret = libxml2mod.xmlTextReaderConstNamespaceUri(self._o)
  6642.         return ret
  6643.  
  6644.     def NewDoc(self, cur, URL, encoding, options):
  6645.         """Setup an xmltextReader to parse an XML in-memory document.
  6646.           The parsing flags @options are a combination of
  6647.           xmlParserOption. This reuses the existing @reader
  6648.            xmlTextReader. """
  6649.         ret = libxml2mod.xmlReaderNewDoc(self._o, cur, URL, encoding, options)
  6650.         return ret
  6651.  
  6652.     def NewFd(self, fd, URL, encoding, options):
  6653.         """Setup an xmltextReader to parse an XML from a file
  6654.           descriptor. NOTE that the file descriptor will not be
  6655.           closed when the reader is closed or reset. The parsing
  6656.           flags @options are a combination of xmlParserOption. This
  6657.            reuses the existing @reader xmlTextReader. """
  6658.         ret = libxml2mod.xmlReaderNewFd(self._o, fd, URL, encoding, options)
  6659.         return ret
  6660.  
  6661.     def NewFile(self, filename, encoding, options):
  6662.         """parse an XML file from the filesystem or the network. The
  6663.           parsing flags @options are a combination of
  6664.           xmlParserOption. This reuses the existing @reader
  6665.            xmlTextReader. """
  6666.         ret = libxml2mod.xmlReaderNewFile(self._o, filename, encoding, options)
  6667.         return ret
  6668.  
  6669.     def NewMemory(self, buffer, size, URL, encoding, options):
  6670.         """Setup an xmltextReader to parse an XML in-memory document.
  6671.           The parsing flags @options are a combination of
  6672.           xmlParserOption. This reuses the existing @reader
  6673.            xmlTextReader. """
  6674.         ret = libxml2mod.xmlReaderNewMemory(self._o, buffer, size, URL, encoding, options)
  6675.         return ret
  6676.  
  6677.     def NewWalker(self, doc):
  6678.         """Setup an xmltextReader to parse a preparsed XML document.
  6679.            This reuses the existing @reader xmlTextReader. """
  6680.         if doc is None: doc__o = None
  6681.         else: doc__o = doc._o
  6682.         ret = libxml2mod.xmlReaderNewWalker(self._o, doc__o)
  6683.         return ret
  6684.  
  6685.     def Next(self):
  6686.         """Skip to the node following the current one in document
  6687.            order while avoiding the subtree if any. """
  6688.         ret = libxml2mod.xmlTextReaderNext(self._o)
  6689.         return ret
  6690.  
  6691.     def NextSibling(self):
  6692.         """Skip to the node following the current one in document
  6693.           order while avoiding the subtree if any. Currently
  6694.            implemented only for Readers built on a document """
  6695.         ret = libxml2mod.xmlTextReaderNextSibling(self._o)
  6696.         return ret
  6697.  
  6698.     def NodeType(self):
  6699.         """Get the node type of the current node Reference:
  6700.           http://www.gnu.org/software/dotgnu/pnetlib-doc/System/Xml/Xm
  6701.           lNodeType.html """
  6702.         ret = libxml2mod.xmlTextReaderNodeType(self._o)
  6703.         return ret
  6704.  
  6705.     def Normalization(self):
  6706.         """The value indicating whether to normalize white space and
  6707.           attribute values. Since attribute value and end of line
  6708.           normalizations are a MUST in the XML specification only the
  6709.           value true is accepted. The broken bahaviour of accepting
  6710.           out of range character entities like � is of course not
  6711.            supported either. """
  6712.         ret = libxml2mod.xmlTextReaderNormalization(self._o)
  6713.         return ret
  6714.  
  6715.     def Prefix(self):
  6716.         """A shorthand reference to the namespace associated with the
  6717.            node. """
  6718.         ret = libxml2mod.xmlTextReaderConstPrefix(self._o)
  6719.         return ret
  6720.  
  6721.     def Preserve(self):
  6722.         """This tells the XML Reader to preserve the current node. The
  6723.           caller must also use xmlTextReaderCurrentDoc() to keep an
  6724.            handle on the resulting document once parsing has finished """
  6725.         ret = libxml2mod.xmlTextReaderPreserve(self._o)
  6726.         if ret is None:raise treeError('xmlTextReaderPreserve() failed')
  6727.         __tmp = xmlNode(_obj=ret)
  6728.         return __tmp
  6729.  
  6730.     def QuoteChar(self):
  6731.         """The quotation mark character used to enclose the value of
  6732.            an attribute. """
  6733.         ret = libxml2mod.xmlTextReaderQuoteChar(self._o)
  6734.         return ret
  6735.  
  6736.     def Read(self):
  6737.         """Moves the position of the current instance to the next node
  6738.            in the stream, exposing its properties. """
  6739.         ret = libxml2mod.xmlTextReaderRead(self._o)
  6740.         return ret
  6741.  
  6742.     def ReadAttributeValue(self):
  6743.         """Parses an attribute value into one or more Text and
  6744.            EntityReference nodes. """
  6745.         ret = libxml2mod.xmlTextReaderReadAttributeValue(self._o)
  6746.         return ret
  6747.  
  6748.     def ReadInnerXml(self):
  6749.         """Reads the contents of the current node, including child
  6750.            nodes and markup. """
  6751.         ret = libxml2mod.xmlTextReaderReadInnerXml(self._o)
  6752.         return ret
  6753.  
  6754.     def ReadOuterXml(self):
  6755.         """Reads the contents of the current node, including child
  6756.            nodes and markup. """
  6757.         ret = libxml2mod.xmlTextReaderReadOuterXml(self._o)
  6758.         return ret
  6759.  
  6760.     def ReadState(self):
  6761.         """Gets the read state of the reader. """
  6762.         ret = libxml2mod.xmlTextReaderReadState(self._o)
  6763.         return ret
  6764.  
  6765.     def ReadString(self):
  6766.         """Reads the contents of an element or a text node as a string. """
  6767.         ret = libxml2mod.xmlTextReaderReadString(self._o)
  6768.         return ret
  6769.  
  6770.     def RelaxNGSetSchema(self, schema):
  6771.         """Use RelaxNG to validate the document as it is processed.
  6772.           Activation is only possible before the first Read(). if
  6773.           @schema is None, then RelaxNG validation is desactivated. @
  6774.           The @schema should not be freed until the reader is
  6775.            deallocated or its use has been deactivated. """
  6776.         if schema is None: schema__o = None
  6777.         else: schema__o = schema._o
  6778.         ret = libxml2mod.xmlTextReaderRelaxNGSetSchema(self._o, schema__o)
  6779.         return ret
  6780.  
  6781.     def RelaxNGValidate(self, rng):
  6782.         """Use RelaxNG to validate the document as it is processed.
  6783.           Activation is only possible before the first Read(). if
  6784.            @rng is None, then RelaxNG validation is deactivated. """
  6785.         ret = libxml2mod.xmlTextReaderRelaxNGValidate(self._o, rng)
  6786.         return ret
  6787.  
  6788.     def SchemaValidate(self, xsd):
  6789.         """Use W3C XSD schema to validate the document as it is
  6790.           processed. Activation is only possible before the first
  6791.           Read(). If @xsd is None, then XML Schema validation is
  6792.            deactivated. """
  6793.         ret = libxml2mod.xmlTextReaderSchemaValidate(self._o, xsd)
  6794.         return ret
  6795.  
  6796.     def SchemaValidateCtxt(self, ctxt, options):
  6797.         """Use W3C XSD schema context to validate the document as it
  6798.           is processed. Activation is only possible before the first
  6799.           Read(). If @ctxt is None, then XML Schema validation is
  6800.            deactivated. """
  6801.         if ctxt is None: ctxt__o = None
  6802.         else: ctxt__o = ctxt._o
  6803.         ret = libxml2mod.xmlTextReaderSchemaValidateCtxt(self._o, ctxt__o, options)
  6804.         return ret
  6805.  
  6806.     def SetParserProp(self, prop, value):
  6807.         """Change the parser processing behaviour by changing some of
  6808.           its internal properties. Note that some properties can only
  6809.            be changed before any read has been done. """
  6810.         ret = libxml2mod.xmlTextReaderSetParserProp(self._o, prop, value)
  6811.         return ret
  6812.  
  6813.     def SetSchema(self, schema):
  6814.         """Use XSD Schema to validate the document as it is processed.
  6815.           Activation is only possible before the first Read(). if
  6816.           @schema is None, then Schema validation is desactivated. @
  6817.           The @schema should not be freed until the reader is
  6818.            deallocated or its use has been deactivated. """
  6819.         if schema is None: schema__o = None
  6820.         else: schema__o = schema._o
  6821.         ret = libxml2mod.xmlTextReaderSetSchema(self._o, schema__o)
  6822.         return ret
  6823.  
  6824.     def Setup(self, input, URL, encoding, options):
  6825.         """Setup an XML reader with new options """
  6826.         if input is None: input__o = None
  6827.         else: input__o = input._o
  6828.         ret = libxml2mod.xmlTextReaderSetup(self._o, input__o, URL, encoding, options)
  6829.         return ret
  6830.  
  6831.     def Standalone(self):
  6832.         """Determine the standalone status of the document being read. """
  6833.         ret = libxml2mod.xmlTextReaderStandalone(self._o)
  6834.         return ret
  6835.  
  6836.     def String(self, str):
  6837.         """Get an interned string from the reader, allows for example
  6838.            to speedup string name comparisons """
  6839.         ret = libxml2mod.xmlTextReaderConstString(self._o, str)
  6840.         return ret
  6841.  
  6842.     def Value(self):
  6843.         """Provides the text value of the node if present """
  6844.         ret = libxml2mod.xmlTextReaderConstValue(self._o)
  6845.         return ret
  6846.  
  6847.     def XmlLang(self):
  6848.         """The xml:lang scope within which the node resides. """
  6849.         ret = libxml2mod.xmlTextReaderConstXmlLang(self._o)
  6850.         return ret
  6851.  
  6852.     def XmlVersion(self):
  6853.         """Determine the XML version of the document being read. """
  6854.         ret = libxml2mod.xmlTextReaderConstXmlVersion(self._o)
  6855.         return ret
  6856.  
  6857. class URI:
  6858.     def __init__(self, _obj=None):
  6859.         if _obj != None:self._o = _obj;return
  6860.         self._o = None
  6861.  
  6862.     def __del__(self):
  6863.         if self._o != None:
  6864.             libxml2mod.xmlFreeURI(self._o)
  6865.         self._o = None
  6866.  
  6867.     # accessors for URI
  6868.     def authority(self):
  6869.         """Get the authority part from an URI """
  6870.         ret = libxml2mod.xmlURIGetAuthority(self._o)
  6871.         return ret
  6872.  
  6873.     def fragment(self):
  6874.         """Get the fragment part from an URI """
  6875.         ret = libxml2mod.xmlURIGetFragment(self._o)
  6876.         return ret
  6877.  
  6878.     def opaque(self):
  6879.         """Get the opaque part from an URI """
  6880.         ret = libxml2mod.xmlURIGetOpaque(self._o)
  6881.         return ret
  6882.  
  6883.     def path(self):
  6884.         """Get the path part from an URI """
  6885.         ret = libxml2mod.xmlURIGetPath(self._o)
  6886.         return ret
  6887.  
  6888.     def port(self):
  6889.         """Get the port part from an URI """
  6890.         ret = libxml2mod.xmlURIGetPort(self._o)
  6891.         return ret
  6892.  
  6893.     def query(self):
  6894.         """Get the query part from an URI """
  6895.         ret = libxml2mod.xmlURIGetQuery(self._o)
  6896.         return ret
  6897.  
  6898.     def queryRaw(self):
  6899.         """Get the raw query part from an URI (i.e. the unescaped
  6900.            form). """
  6901.         ret = libxml2mod.xmlURIGetQueryRaw(self._o)
  6902.         return ret
  6903.  
  6904.     def scheme(self):
  6905.         """Get the scheme part from an URI """
  6906.         ret = libxml2mod.xmlURIGetScheme(self._o)
  6907.         return ret
  6908.  
  6909.     def server(self):
  6910.         """Get the server part from an URI """
  6911.         ret = libxml2mod.xmlURIGetServer(self._o)
  6912.         return ret
  6913.  
  6914.     def setAuthority(self, authority):
  6915.         """Set the authority part of an URI. """
  6916.         libxml2mod.xmlURISetAuthority(self._o, authority)
  6917.  
  6918.     def setFragment(self, fragment):
  6919.         """Set the fragment part of an URI. """
  6920.         libxml2mod.xmlURISetFragment(self._o, fragment)
  6921.  
  6922.     def setOpaque(self, opaque):
  6923.         """Set the opaque part of an URI. """
  6924.         libxml2mod.xmlURISetOpaque(self._o, opaque)
  6925.  
  6926.     def setPath(self, path):
  6927.         """Set the path part of an URI. """
  6928.         libxml2mod.xmlURISetPath(self._o, path)
  6929.  
  6930.     def setPort(self, port):
  6931.         """Set the port part of an URI. """
  6932.         libxml2mod.xmlURISetPort(self._o, port)
  6933.  
  6934.     def setQuery(self, query):
  6935.         """Set the query part of an URI. """
  6936.         libxml2mod.xmlURISetQuery(self._o, query)
  6937.  
  6938.     def setQueryRaw(self, query_raw):
  6939.         """Set the raw query part of an URI (i.e. the unescaped form). """
  6940.         libxml2mod.xmlURISetQueryRaw(self._o, query_raw)
  6941.  
  6942.     def setScheme(self, scheme):
  6943.         """Set the scheme part of an URI. """
  6944.         libxml2mod.xmlURISetScheme(self._o, scheme)
  6945.  
  6946.     def setServer(self, server):
  6947.         """Set the server part of an URI. """
  6948.         libxml2mod.xmlURISetServer(self._o, server)
  6949.  
  6950.     def setUser(self, user):
  6951.         """Set the user part of an URI. """
  6952.         libxml2mod.xmlURISetUser(self._o, user)
  6953.  
  6954.     def user(self):
  6955.         """Get the user part from an URI """
  6956.         ret = libxml2mod.xmlURIGetUser(self._o)
  6957.         return ret
  6958.  
  6959.     #
  6960.     # URI functions from module uri
  6961.     #
  6962.  
  6963.     def parseURIReference(self, str):
  6964.         """Parse an URI reference string based on RFC 3986 and fills
  6965.           in the appropriate fields of the @uri structure 
  6966.            URI-reference = URI / relative-ref """
  6967.         ret = libxml2mod.xmlParseURIReference(self._o, str)
  6968.         return ret
  6969.  
  6970.     def printURI(self, stream):
  6971.         """Prints the URI in the stream @stream. """
  6972.         libxml2mod.xmlPrintURI(stream, self._o)
  6973.  
  6974.     def saveUri(self):
  6975.         """Save the URI as an escaped string """
  6976.         ret = libxml2mod.xmlSaveUri(self._o)
  6977.         return ret
  6978.  
  6979. class ValidCtxt(ValidCtxtCore):
  6980.     def __init__(self, _obj=None):
  6981.         self._o = _obj
  6982.         ValidCtxtCore.__init__(self, _obj=_obj)
  6983.  
  6984.     def __del__(self):
  6985.         if self._o != None:
  6986.             libxml2mod.xmlFreeValidCtxt(self._o)
  6987.         self._o = None
  6988.  
  6989.     #
  6990.     # ValidCtxt functions from module valid
  6991.     #
  6992.  
  6993.     def validCtxtNormalizeAttributeValue(self, doc, elem, name, value):
  6994.         """Does the validation related extra step of the normalization
  6995.           of attribute values:  If the declared value is not CDATA,
  6996.           then the XML processor must further process the normalized
  6997.           attribute value by discarding any leading and trailing
  6998.           space (#x20) characters, and by replacing sequences of
  6999.           space (#x20) characters by single space (#x20) character. 
  7000.           Also  check VC: Standalone Document Declaration in P32, and
  7001.            update ctxt->valid accordingly """
  7002.         if doc is None: doc__o = None
  7003.         else: doc__o = doc._o
  7004.         if elem is None: elem__o = None
  7005.         else: elem__o = elem._o
  7006.         ret = libxml2mod.xmlValidCtxtNormalizeAttributeValue(self._o, doc__o, elem__o, name, value)
  7007.         return ret
  7008.  
  7009.     def validateDocument(self, doc):
  7010.         """Try to validate the document instance  basically it does
  7011.           the all the checks described by the XML Rec i.e. validates
  7012.           the internal and external subset (if present) and validate
  7013.            the document tree. """
  7014.         if doc is None: doc__o = None
  7015.         else: doc__o = doc._o
  7016.         ret = libxml2mod.xmlValidateDocument(self._o, doc__o)
  7017.         return ret
  7018.  
  7019.     def validateDocumentFinal(self, doc):
  7020.         """Does the final step for the document validation once all
  7021.           the incremental validation steps have been completed 
  7022.           basically it does the following checks described by the XML
  7023.           Rec  Check all the IDREF/IDREFS attributes definition for
  7024.            validity """
  7025.         if doc is None: doc__o = None
  7026.         else: doc__o = doc._o
  7027.         ret = libxml2mod.xmlValidateDocumentFinal(self._o, doc__o)
  7028.         return ret
  7029.  
  7030.     def validateDtd(self, doc, dtd):
  7031.         """Try to validate the document against the dtd instance 
  7032.           Basically it does check all the definitions in the DtD.
  7033.           Note the the internal subset (if present) is de-coupled
  7034.           (i.e. not used), which could give problems if ID or IDREF
  7035.            is present. """
  7036.         if doc is None: doc__o = None
  7037.         else: doc__o = doc._o
  7038.         if dtd is None: dtd__o = None
  7039.         else: dtd__o = dtd._o
  7040.         ret = libxml2mod.xmlValidateDtd(self._o, doc__o, dtd__o)
  7041.         return ret
  7042.  
  7043.     def validateDtdFinal(self, doc):
  7044.         """Does the final step for the dtds validation once all the
  7045.           subsets have been parsed  basically it does the following
  7046.           checks described by the XML Rec - check that ENTITY and
  7047.           ENTITIES type attributes default or possible values matches
  7048.           one of the defined entities. - check that NOTATION type
  7049.           attributes default or possible values matches one of the
  7050.            defined notations. """
  7051.         if doc is None: doc__o = None
  7052.         else: doc__o = doc._o
  7053.         ret = libxml2mod.xmlValidateDtdFinal(self._o, doc__o)
  7054.         return ret
  7055.  
  7056.     def validateElement(self, doc, elem):
  7057.         """Try to validate the subtree under an element """
  7058.         if doc is None: doc__o = None
  7059.         else: doc__o = doc._o
  7060.         if elem is None: elem__o = None
  7061.         else: elem__o = elem._o
  7062.         ret = libxml2mod.xmlValidateElement(self._o, doc__o, elem__o)
  7063.         return ret
  7064.  
  7065.     def validateNotationUse(self, doc, notationName):
  7066.         """Validate that the given name match a notation declaration.
  7067.            - [ VC: Notation Declared ] """
  7068.         if doc is None: doc__o = None
  7069.         else: doc__o = doc._o
  7070.         ret = libxml2mod.xmlValidateNotationUse(self._o, doc__o, notationName)
  7071.         return ret
  7072.  
  7073.     def validateOneAttribute(self, doc, elem, attr, value):
  7074.         """Try to validate a single attribute for an element basically
  7075.           it does the following checks as described by the XML-1.0
  7076.           recommendation: - [ VC: Attribute Value Type ] - [ VC:
  7077.           Fixed Attribute Default ] - [ VC: Entity Name ] - [ VC:
  7078.           Name Token ] - [ VC: ID ] - [ VC: IDREF ] - [ VC: Entity
  7079.           Name ] - [ VC: Notation Attributes ]  The ID/IDREF
  7080.            uniqueness and matching are done separately """
  7081.         if doc is None: doc__o = None
  7082.         else: doc__o = doc._o
  7083.         if elem is None: elem__o = None
  7084.         else: elem__o = elem._o
  7085.         if attr is None: attr__o = None
  7086.         else: attr__o = attr._o
  7087.         ret = libxml2mod.xmlValidateOneAttribute(self._o, doc__o, elem__o, attr__o, value)
  7088.         return ret
  7089.  
  7090.     def validateOneElement(self, doc, elem):
  7091.         """Try to validate a single element and it's attributes,
  7092.           basically it does the following checks as described by the
  7093.           XML-1.0 recommendation: - [ VC: Element Valid ] - [ VC:
  7094.           Required Attribute ] Then call xmlValidateOneAttribute()
  7095.           for each attribute present.  The ID/IDREF checkings are
  7096.            done separately """
  7097.         if doc is None: doc__o = None
  7098.         else: doc__o = doc._o
  7099.         if elem is None: elem__o = None
  7100.         else: elem__o = elem._o
  7101.         ret = libxml2mod.xmlValidateOneElement(self._o, doc__o, elem__o)
  7102.         return ret
  7103.  
  7104.     def validateOneNamespace(self, doc, elem, prefix, ns, value):
  7105.         """Try to validate a single namespace declaration for an
  7106.           element basically it does the following checks as described
  7107.           by the XML-1.0 recommendation: - [ VC: Attribute Value Type
  7108.           ] - [ VC: Fixed Attribute Default ] - [ VC: Entity Name ] -
  7109.           [ VC: Name Token ] - [ VC: ID ] - [ VC: IDREF ] - [ VC:
  7110.           Entity Name ] - [ VC: Notation Attributes ]  The ID/IDREF
  7111.            uniqueness and matching are done separately """
  7112.         if doc is None: doc__o = None
  7113.         else: doc__o = doc._o
  7114.         if elem is None: elem__o = None
  7115.         else: elem__o = elem._o
  7116.         if ns is None: ns__o = None
  7117.         else: ns__o = ns._o
  7118.         ret = libxml2mod.xmlValidateOneNamespace(self._o, doc__o, elem__o, prefix, ns__o, value)
  7119.         return ret
  7120.  
  7121.     def validatePopElement(self, doc, elem, qname):
  7122.         """Pop the element end from the validation stack. """
  7123.         if doc is None: doc__o = None
  7124.         else: doc__o = doc._o
  7125.         if elem is None: elem__o = None
  7126.         else: elem__o = elem._o
  7127.         ret = libxml2mod.xmlValidatePopElement(self._o, doc__o, elem__o, qname)
  7128.         return ret
  7129.  
  7130.     def validatePushCData(self, data, len):
  7131.         """check the CData parsed for validation in the current stack """
  7132.         ret = libxml2mod.xmlValidatePushCData(self._o, data, len)
  7133.         return ret
  7134.  
  7135.     def validatePushElement(self, doc, elem, qname):
  7136.         """Push a new element start on the validation stack. """
  7137.         if doc is None: doc__o = None
  7138.         else: doc__o = doc._o
  7139.         if elem is None: elem__o = None
  7140.         else: elem__o = elem._o
  7141.         ret = libxml2mod.xmlValidatePushElement(self._o, doc__o, elem__o, qname)
  7142.         return ret
  7143.  
  7144.     def validateRoot(self, doc):
  7145.         """Try to validate a the root element basically it does the
  7146.           following check as described by the XML-1.0 recommendation:
  7147.           - [ VC: Root Element Type ] it doesn't try to recurse or
  7148.            apply other check to the element """
  7149.         if doc is None: doc__o = None
  7150.         else: doc__o = doc._o
  7151.         ret = libxml2mod.xmlValidateRoot(self._o, doc__o)
  7152.         return ret
  7153.  
  7154. class xpathContext:
  7155.     def __init__(self, _obj=None):
  7156.         if _obj != None:self._o = _obj;return
  7157.         self._o = None
  7158.  
  7159.     # accessors for xpathContext
  7160.     def contextDoc(self):
  7161.         """Get the doc from an xpathContext """
  7162.         ret = libxml2mod.xmlXPathGetContextDoc(self._o)
  7163.         if ret is None:raise xpathError('xmlXPathGetContextDoc() failed')
  7164.         __tmp = xmlDoc(_obj=ret)
  7165.         return __tmp
  7166.  
  7167.     def contextNode(self):
  7168.         """Get the current node from an xpathContext """
  7169.         ret = libxml2mod.xmlXPathGetContextNode(self._o)
  7170.         if ret is None:raise xpathError('xmlXPathGetContextNode() failed')
  7171.         __tmp = xmlNode(_obj=ret)
  7172.         return __tmp
  7173.  
  7174.     def contextPosition(self):
  7175.         """Get the current node from an xpathContext """
  7176.         ret = libxml2mod.xmlXPathGetContextPosition(self._o)
  7177.         return ret
  7178.  
  7179.     def contextSize(self):
  7180.         """Get the current node from an xpathContext """
  7181.         ret = libxml2mod.xmlXPathGetContextSize(self._o)
  7182.         return ret
  7183.  
  7184.     def function(self):
  7185.         """Get the current function name xpathContext """
  7186.         ret = libxml2mod.xmlXPathGetFunction(self._o)
  7187.         return ret
  7188.  
  7189.     def functionURI(self):
  7190.         """Get the current function name URI xpathContext """
  7191.         ret = libxml2mod.xmlXPathGetFunctionURI(self._o)
  7192.         return ret
  7193.  
  7194.     def setContextDoc(self, doc):
  7195.         """Set the doc of an xpathContext """
  7196.         if doc is None: doc__o = None
  7197.         else: doc__o = doc._o
  7198.         libxml2mod.xmlXPathSetContextDoc(self._o, doc__o)
  7199.  
  7200.     def setContextNode(self, node):
  7201.         """Set the current node of an xpathContext """
  7202.         if node is None: node__o = None
  7203.         else: node__o = node._o
  7204.         libxml2mod.xmlXPathSetContextNode(self._o, node__o)
  7205.  
  7206.     #
  7207.     # xpathContext functions from module python
  7208.     #
  7209.  
  7210.     def registerXPathFunction(self, name, ns_uri, f):
  7211.         """Register a Python written function to the XPath interpreter """
  7212.         ret = libxml2mod.xmlRegisterXPathFunction(self._o, name, ns_uri, f)
  7213.         return ret
  7214.  
  7215.     #
  7216.     # xpathContext functions from module xpath
  7217.     #
  7218.  
  7219.     def xpathContextSetCache(self, active, value, options):
  7220.         """Creates/frees an object cache on the XPath context. If
  7221.           activates XPath objects (xmlXPathObject) will be cached
  7222.           internally to be reused. @options: 0: This will set the
  7223.           XPath object caching: @value: This will set the maximum
  7224.           number of XPath objects to be cached per slot There are 5
  7225.           slots for: node-set, string, number, boolean, and misc
  7226.           objects. Use <0 for the default number (100). Other values
  7227.            for @options have currently no effect. """
  7228.         ret = libxml2mod.xmlXPathContextSetCache(self._o, active, value, options)
  7229.         return ret
  7230.  
  7231.     def xpathEval(self, str):
  7232.         """Evaluate the XPath Location Path in the given context. """
  7233.         ret = libxml2mod.xmlXPathEval(str, self._o)
  7234.         if ret is None:raise xpathError('xmlXPathEval() failed')
  7235.         return xpathObjectRet(ret)
  7236.  
  7237.     def xpathEvalExpression(self, str):
  7238.         """Evaluate the XPath expression in the given context. """
  7239.         ret = libxml2mod.xmlXPathEvalExpression(str, self._o)
  7240.         if ret is None:raise xpathError('xmlXPathEvalExpression() failed')
  7241.         return xpathObjectRet(ret)
  7242.  
  7243.     def xpathFreeContext(self):
  7244.         """Free up an xmlXPathContext """
  7245.         libxml2mod.xmlXPathFreeContext(self._o)
  7246.  
  7247.     #
  7248.     # xpathContext functions from module xpathInternals
  7249.     #
  7250.  
  7251.     def xpathNewParserContext(self, str):
  7252.         """Create a new xmlXPathParserContext """
  7253.         ret = libxml2mod.xmlXPathNewParserContext(str, self._o)
  7254.         if ret is None:raise xpathError('xmlXPathNewParserContext() failed')
  7255.         __tmp = xpathParserContext(_obj=ret)
  7256.         return __tmp
  7257.  
  7258.     def xpathNsLookup(self, prefix):
  7259.         """Search in the namespace declaration array of the context
  7260.            for the given namespace name associated to the given prefix """
  7261.         ret = libxml2mod.xmlXPathNsLookup(self._o, prefix)
  7262.         return ret
  7263.  
  7264.     def xpathRegisterAllFunctions(self):
  7265.         """Registers all default XPath functions in this context """
  7266.         libxml2mod.xmlXPathRegisterAllFunctions(self._o)
  7267.  
  7268.     def xpathRegisterNs(self, prefix, ns_uri):
  7269.         """Register a new namespace. If @ns_uri is None it unregisters
  7270.            the namespace """
  7271.         ret = libxml2mod.xmlXPathRegisterNs(self._o, prefix, ns_uri)
  7272.         return ret
  7273.  
  7274.     def xpathRegisteredFuncsCleanup(self):
  7275.         """Cleanup the XPath context data associated to registered
  7276.            functions """
  7277.         libxml2mod.xmlXPathRegisteredFuncsCleanup(self._o)
  7278.  
  7279.     def xpathRegisteredNsCleanup(self):
  7280.         """Cleanup the XPath context data associated to registered
  7281.            variables """
  7282.         libxml2mod.xmlXPathRegisteredNsCleanup(self._o)
  7283.  
  7284.     def xpathRegisteredVariablesCleanup(self):
  7285.         """Cleanup the XPath context data associated to registered
  7286.            variables """
  7287.         libxml2mod.xmlXPathRegisteredVariablesCleanup(self._o)
  7288.  
  7289.     def xpathVariableLookup(self, name):
  7290.         """Search in the Variable array of the context for the given
  7291.            variable value. """
  7292.         ret = libxml2mod.xmlXPathVariableLookup(self._o, name)
  7293.         if ret is None:raise xpathError('xmlXPathVariableLookup() failed')
  7294.         return xpathObjectRet(ret)
  7295.  
  7296.     def xpathVariableLookupNS(self, name, ns_uri):
  7297.         """Search in the Variable array of the context for the given
  7298.            variable value. """
  7299.         ret = libxml2mod.xmlXPathVariableLookupNS(self._o, name, ns_uri)
  7300.         if ret is None:raise xpathError('xmlXPathVariableLookupNS() failed')
  7301.         return xpathObjectRet(ret)
  7302.  
  7303.     #
  7304.     # xpathContext functions from module xpointer
  7305.     #
  7306.  
  7307.     def xpointerEval(self, str):
  7308.         """Evaluate the XPath Location Path in the given context. """
  7309.         ret = libxml2mod.xmlXPtrEval(str, self._o)
  7310.         if ret is None:raise treeError('xmlXPtrEval() failed')
  7311.         return xpathObjectRet(ret)
  7312.  
  7313. class xpathParserContext:
  7314.     def __init__(self, _obj=None):
  7315.         if _obj != None:self._o = _obj;return
  7316.         self._o = None
  7317.  
  7318.     # accessors for xpathParserContext
  7319.     def context(self):
  7320.         """Get the xpathContext from an xpathParserContext """
  7321.         ret = libxml2mod.xmlXPathParserGetContext(self._o)
  7322.         if ret is None:raise xpathError('xmlXPathParserGetContext() failed')
  7323.         __tmp = xpathContext(_obj=ret)
  7324.         return __tmp
  7325.  
  7326.     #
  7327.     # xpathParserContext functions from module xpathInternals
  7328.     #
  7329.  
  7330.     def xpathAddValues(self):
  7331.         """Implement the add operation on XPath objects: The numeric
  7332.           operators convert their operands to numbers as if by
  7333.            calling the number function. """
  7334.         libxml2mod.xmlXPathAddValues(self._o)
  7335.  
  7336.     def xpathBooleanFunction(self, nargs):
  7337.         """Implement the boolean() XPath function boolean
  7338.           boolean(object) The boolean function converts its argument
  7339.           to a boolean as follows: - a number is true if and only if
  7340.           it is neither positive or negative zero nor NaN - a
  7341.           node-set is true if and only if it is non-empty - a string
  7342.            is true if and only if its length is non-zero """
  7343.         libxml2mod.xmlXPathBooleanFunction(self._o, nargs)
  7344.  
  7345.     def xpathCeilingFunction(self, nargs):
  7346.         """Implement the ceiling() XPath function number
  7347.           ceiling(number) The ceiling function returns the smallest
  7348.           (closest to negative infinity) number that is not less than
  7349.            the argument and that is an integer. """
  7350.         libxml2mod.xmlXPathCeilingFunction(self._o, nargs)
  7351.  
  7352.     def xpathCompareValues(self, inf, strict):
  7353.         """Implement the compare operation on XPath objects: @arg1 <
  7354.           @arg2    (1, 1, ... @arg1 <= @arg2   (1, 0, ... @arg1 >
  7355.           @arg2    (0, 1, ... @arg1 >= @arg2   (0, 0, ...  When
  7356.           neither object to be compared is a node-set and the
  7357.           operator is <=, <, >=, >, then the objects are compared by
  7358.           converted both objects to numbers and comparing the numbers
  7359.           according to IEEE 754. The < comparison will be true if and
  7360.           only if the first number is less than the second number.
  7361.           The <= comparison will be true if and only if the first
  7362.           number is less than or equal to the second number. The >
  7363.           comparison will be true if and only if the first number is
  7364.           greater than the second number. The >= comparison will be
  7365.           true if and only if the first number is greater than or
  7366.            equal to the second number. """
  7367.         ret = libxml2mod.xmlXPathCompareValues(self._o, inf, strict)
  7368.         return ret
  7369.  
  7370.     def xpathConcatFunction(self, nargs):
  7371.         """Implement the concat() XPath function string concat(string,
  7372.           string, string*) The concat function returns the
  7373.            concatenation of its arguments. """
  7374.         libxml2mod.xmlXPathConcatFunction(self._o, nargs)
  7375.  
  7376.     def xpathContainsFunction(self, nargs):
  7377.         """Implement the contains() XPath function boolean
  7378.           contains(string, string) The contains function returns true
  7379.           if the first argument string contains the second argument
  7380.            string, and otherwise returns false. """
  7381.         libxml2mod.xmlXPathContainsFunction(self._o, nargs)
  7382.  
  7383.     def xpathCountFunction(self, nargs):
  7384.         """Implement the count() XPath function number count(node-set) """
  7385.         libxml2mod.xmlXPathCountFunction(self._o, nargs)
  7386.  
  7387.     def xpathDivValues(self):
  7388.         """Implement the div operation on XPath objects @arg1 / @arg2:
  7389.           The numeric operators convert their operands to numbers as
  7390.            if by calling the number function. """
  7391.         libxml2mod.xmlXPathDivValues(self._o)
  7392.  
  7393.     def xpathEqualValues(self):
  7394.         """Implement the equal operation on XPath objects content:
  7395.            @arg1 == @arg2 """
  7396.         ret = libxml2mod.xmlXPathEqualValues(self._o)
  7397.         return ret
  7398.  
  7399.     def xpathErr(self, error):
  7400.         """Handle an XPath error """
  7401.         libxml2mod.xmlXPathErr(self._o, error)
  7402.  
  7403.     def xpathEvalExpr(self):
  7404.         """Parse and evaluate an XPath expression in the given
  7405.            context, then push the result on the context stack """
  7406.         libxml2mod.xmlXPathEvalExpr(self._o)
  7407.  
  7408.     def xpathFalseFunction(self, nargs):
  7409.         """Implement the false() XPath function boolean false() """
  7410.         libxml2mod.xmlXPathFalseFunction(self._o, nargs)
  7411.  
  7412.     def xpathFloorFunction(self, nargs):
  7413.         """Implement the floor() XPath function number floor(number)
  7414.           The floor function returns the largest (closest to positive
  7415.           infinity) number that is not greater than the argument and
  7416.            that is an integer. """
  7417.         libxml2mod.xmlXPathFloorFunction(self._o, nargs)
  7418.  
  7419.     def xpathFreeParserContext(self):
  7420.         """Free up an xmlXPathParserContext """
  7421.         libxml2mod.xmlXPathFreeParserContext(self._o)
  7422.  
  7423.     def xpathIdFunction(self, nargs):
  7424.         """Implement the id() XPath function node-set id(object) The
  7425.           id function selects elements by their unique ID (see [5.2.1
  7426.           Unique IDs]). When the argument to id is of type node-set,
  7427.           then the result is the union of the result of applying id
  7428.           to the string value of each of the nodes in the argument
  7429.           node-set. When the argument to id is of any other type, the
  7430.           argument is converted to a string as if by a call to the
  7431.           string function; the string is split into a
  7432.           whitespace-separated list of tokens (whitespace is any
  7433.           sequence of characters matching the production S); the
  7434.           result is a node-set containing the elements in the same
  7435.           document as the context node that have a unique ID equal to
  7436.            any of the tokens in the list. """
  7437.         libxml2mod.xmlXPathIdFunction(self._o, nargs)
  7438.  
  7439.     def xpathLangFunction(self, nargs):
  7440.         """Implement the lang() XPath function boolean lang(string)
  7441.           The lang function returns true or false depending on
  7442.           whether the language of the context node as specified by
  7443.           xml:lang attributes is the same as or is a sublanguage of
  7444.           the language specified by the argument string. The language
  7445.           of the context node is determined by the value of the
  7446.           xml:lang attribute on the context node, or, if the context
  7447.           node has no xml:lang attribute, by the value of the
  7448.           xml:lang attribute on the nearest ancestor of the context
  7449.           node that has an xml:lang attribute. If there is no such
  7450.            attribute, then lang """
  7451.         libxml2mod.xmlXPathLangFunction(self._o, nargs)
  7452.  
  7453.     def xpathLastFunction(self, nargs):
  7454.         """Implement the last() XPath function number last() The last
  7455.           function returns the number of nodes in the context node
  7456.            list. """
  7457.         libxml2mod.xmlXPathLastFunction(self._o, nargs)
  7458.  
  7459.     def xpathLocalNameFunction(self, nargs):
  7460.         """Implement the local-name() XPath function string
  7461.           local-name(node-set?) The local-name function returns a
  7462.           string containing the local part of the name of the node in
  7463.           the argument node-set that is first in document order. If
  7464.           the node-set is empty or the first node has no name, an
  7465.           empty string is returned. If the argument is omitted it
  7466.            defaults to the context node. """
  7467.         libxml2mod.xmlXPathLocalNameFunction(self._o, nargs)
  7468.  
  7469.     def xpathModValues(self):
  7470.         """Implement the mod operation on XPath objects: @arg1 / @arg2
  7471.           The numeric operators convert their operands to numbers as
  7472.            if by calling the number function. """
  7473.         libxml2mod.xmlXPathModValues(self._o)
  7474.  
  7475.     def xpathMultValues(self):
  7476.         """Implement the multiply operation on XPath objects: The
  7477.           numeric operators convert their operands to numbers as if
  7478.            by calling the number function. """
  7479.         libxml2mod.xmlXPathMultValues(self._o)
  7480.  
  7481.     def xpathNamespaceURIFunction(self, nargs):
  7482.         """Implement the namespace-uri() XPath function string
  7483.           namespace-uri(node-set?) The namespace-uri function returns
  7484.           a string containing the namespace URI of the expanded name
  7485.           of the node in the argument node-set that is first in
  7486.           document order. If the node-set is empty, the first node
  7487.           has no name, or the expanded name has no namespace URI, an
  7488.           empty string is returned. If the argument is omitted it
  7489.            defaults to the context node. """
  7490.         libxml2mod.xmlXPathNamespaceURIFunction(self._o, nargs)
  7491.  
  7492.     def xpathNextAncestor(self, cur):
  7493.         """Traversal function for the "ancestor" direction the
  7494.           ancestor axis contains the ancestors of the context node;
  7495.           the ancestors of the context node consist of the parent of
  7496.           context node and the parent's parent and so on; the nodes
  7497.           are ordered in reverse document order; thus the parent is
  7498.           the first node on the axis, and the parent's parent is the
  7499.            second node on the axis """
  7500.         if cur is None: cur__o = None
  7501.         else: cur__o = cur._o
  7502.         ret = libxml2mod.xmlXPathNextAncestor(self._o, cur__o)
  7503.         if ret is None:raise xpathError('xmlXPathNextAncestor() failed')
  7504.         __tmp = xmlNode(_obj=ret)
  7505.         return __tmp
  7506.  
  7507.     def xpathNextAncestorOrSelf(self, cur):
  7508.         """Traversal function for the "ancestor-or-self" direction he
  7509.           ancestor-or-self axis contains the context node and
  7510.           ancestors of the context node in reverse document order;
  7511.           thus the context node is the first node on the axis, and
  7512.           the context node's parent the second; parent here is
  7513.            defined the same as with the parent axis. """
  7514.         if cur is None: cur__o = None
  7515.         else: cur__o = cur._o
  7516.         ret = libxml2mod.xmlXPathNextAncestorOrSelf(self._o, cur__o)
  7517.         if ret is None:raise xpathError('xmlXPathNextAncestorOrSelf() failed')
  7518.         __tmp = xmlNode(_obj=ret)
  7519.         return __tmp
  7520.  
  7521.     def xpathNextAttribute(self, cur):
  7522.         """Traversal function for the "attribute" direction TODO:
  7523.            support DTD inherited default attributes """
  7524.         if cur is None: cur__o = None
  7525.         else: cur__o = cur._o
  7526.         ret = libxml2mod.xmlXPathNextAttribute(self._o, cur__o)
  7527.         if ret is None:raise xpathError('xmlXPathNextAttribute() failed')
  7528.         __tmp = xmlNode(_obj=ret)
  7529.         return __tmp
  7530.  
  7531.     def xpathNextChild(self, cur):
  7532.         """Traversal function for the "child" direction The child axis
  7533.           contains the children of the context node in document order. """
  7534.         if cur is None: cur__o = None
  7535.         else: cur__o = cur._o
  7536.         ret = libxml2mod.xmlXPathNextChild(self._o, cur__o)
  7537.         if ret is None:raise xpathError('xmlXPathNextChild() failed')
  7538.         __tmp = xmlNode(_obj=ret)
  7539.         return __tmp
  7540.  
  7541.     def xpathNextDescendant(self, cur):
  7542.         """Traversal function for the "descendant" direction the
  7543.           descendant axis contains the descendants of the context
  7544.           node in document order; a descendant is a child or a child
  7545.            of a child and so on. """
  7546.         if cur is None: cur__o = None
  7547.         else: cur__o = cur._o
  7548.         ret = libxml2mod.xmlXPathNextDescendant(self._o, cur__o)
  7549.         if ret is None:raise xpathError('xmlXPathNextDescendant() failed')
  7550.         __tmp = xmlNode(_obj=ret)
  7551.         return __tmp
  7552.  
  7553.     def xpathNextDescendantOrSelf(self, cur):
  7554.         """Traversal function for the "descendant-or-self" direction
  7555.           the descendant-or-self axis contains the context node and
  7556.           the descendants of the context node in document order; thus
  7557.           the context node is the first node on the axis, and the
  7558.           first child of the context node is the second node on the
  7559.            axis """
  7560.         if cur is None: cur__o = None
  7561.         else: cur__o = cur._o
  7562.         ret = libxml2mod.xmlXPathNextDescendantOrSelf(self._o, cur__o)
  7563.         if ret is None:raise xpathError('xmlXPathNextDescendantOrSelf() failed')
  7564.         __tmp = xmlNode(_obj=ret)
  7565.         return __tmp
  7566.  
  7567.     def xpathNextFollowing(self, cur):
  7568.         """Traversal function for the "following" direction The
  7569.           following axis contains all nodes in the same document as
  7570.           the context node that are after the context node in
  7571.           document order, excluding any descendants and excluding
  7572.           attribute nodes and namespace nodes; the nodes are ordered
  7573.            in document order """
  7574.         if cur is None: cur__o = None
  7575.         else: cur__o = cur._o
  7576.         ret = libxml2mod.xmlXPathNextFollowing(self._o, cur__o)
  7577.         if ret is None:raise xpathError('xmlXPathNextFollowing() failed')
  7578.         __tmp = xmlNode(_obj=ret)
  7579.         return __tmp
  7580.  
  7581.     def xpathNextFollowingSibling(self, cur):
  7582.         """Traversal function for the "following-sibling" direction
  7583.           The following-sibling axis contains the following siblings
  7584.            of the context node in document order. """
  7585.         if cur is None: cur__o = None
  7586.         else: cur__o = cur._o
  7587.         ret = libxml2mod.xmlXPathNextFollowingSibling(self._o, cur__o)
  7588.         if ret is None:raise xpathError('xmlXPathNextFollowingSibling() failed')
  7589.         __tmp = xmlNode(_obj=ret)
  7590.         return __tmp
  7591.  
  7592.     def xpathNextNamespace(self, cur):
  7593.         """Traversal function for the "namespace" direction the
  7594.           namespace axis contains the namespace nodes of the context
  7595.           node; the order of nodes on this axis is
  7596.           implementation-defined; the axis will be empty unless the
  7597.           context node is an element  We keep the XML namespace node
  7598.            at the end of the list. """
  7599.         if cur is None: cur__o = None
  7600.         else: cur__o = cur._o
  7601.         ret = libxml2mod.xmlXPathNextNamespace(self._o, cur__o)
  7602.         if ret is None:raise xpathError('xmlXPathNextNamespace() failed')
  7603.         __tmp = xmlNode(_obj=ret)
  7604.         return __tmp
  7605.  
  7606.     def xpathNextParent(self, cur):
  7607.         """Traversal function for the "parent" direction The parent
  7608.           axis contains the parent of the context node, if there is
  7609.            one. """
  7610.         if cur is None: cur__o = None
  7611.         else: cur__o = cur._o
  7612.         ret = libxml2mod.xmlXPathNextParent(self._o, cur__o)
  7613.         if ret is None:raise xpathError('xmlXPathNextParent() failed')
  7614.         __tmp = xmlNode(_obj=ret)
  7615.         return __tmp
  7616.  
  7617.     def xpathNextPreceding(self, cur):
  7618.         """Traversal function for the "preceding" direction the
  7619.           preceding axis contains all nodes in the same document as
  7620.           the context node that are before the context node in
  7621.           document order, excluding any ancestors and excluding
  7622.           attribute nodes and namespace nodes; the nodes are ordered
  7623.            in reverse document order """
  7624.         if cur is None: cur__o = None
  7625.         else: cur__o = cur._o
  7626.         ret = libxml2mod.xmlXPathNextPreceding(self._o, cur__o)
  7627.         if ret is None:raise xpathError('xmlXPathNextPreceding() failed')
  7628.         __tmp = xmlNode(_obj=ret)
  7629.         return __tmp
  7630.  
  7631.     def xpathNextPrecedingSibling(self, cur):
  7632.         """Traversal function for the "preceding-sibling" direction
  7633.           The preceding-sibling axis contains the preceding siblings
  7634.           of the context node in reverse document order; the first
  7635.           preceding sibling is first on the axis; the sibling
  7636.            preceding that node is the second on the axis and so on. """
  7637.         if cur is None: cur__o = None
  7638.         else: cur__o = cur._o
  7639.         ret = libxml2mod.xmlXPathNextPrecedingSibling(self._o, cur__o)
  7640.         if ret is None:raise xpathError('xmlXPathNextPrecedingSibling() failed')
  7641.         __tmp = xmlNode(_obj=ret)
  7642.         return __tmp
  7643.  
  7644.     def xpathNextSelf(self, cur):
  7645.         """Traversal function for the "self" direction The self axis
  7646.            contains just the context node itself """
  7647.         if cur is None: cur__o = None
  7648.         else: cur__o = cur._o
  7649.         ret = libxml2mod.xmlXPathNextSelf(self._o, cur__o)
  7650.         if ret is None:raise xpathError('xmlXPathNextSelf() failed')
  7651.         __tmp = xmlNode(_obj=ret)
  7652.         return __tmp
  7653.  
  7654.     def xpathNormalizeFunction(self, nargs):
  7655.         """Implement the normalize-space() XPath function string
  7656.           normalize-space(string?) The normalize-space function
  7657.           returns the argument string with white space normalized by
  7658.           stripping leading and trailing whitespace and replacing
  7659.           sequences of whitespace characters by a single space.
  7660.           Whitespace characters are the same allowed by the S
  7661.           production in XML. If the argument is omitted, it defaults
  7662.           to the context node converted to a string, in other words
  7663.            the value of the context node. """
  7664.         libxml2mod.xmlXPathNormalizeFunction(self._o, nargs)
  7665.  
  7666.     def xpathNotEqualValues(self):
  7667.         """Implement the equal operation on XPath objects content:
  7668.            @arg1 == @arg2 """
  7669.         ret = libxml2mod.xmlXPathNotEqualValues(self._o)
  7670.         return ret
  7671.  
  7672.     def xpathNotFunction(self, nargs):
  7673.         """Implement the not() XPath function boolean not(boolean) The
  7674.           not function returns true if its argument is false, and
  7675.            false otherwise. """
  7676.         libxml2mod.xmlXPathNotFunction(self._o, nargs)
  7677.  
  7678.     def xpathNumberFunction(self, nargs):
  7679.         """Implement the number() XPath function number number(object?) """
  7680.         libxml2mod.xmlXPathNumberFunction(self._o, nargs)
  7681.  
  7682.     def xpathParseNCName(self):
  7683.         """parse an XML namespace non qualified name.  [NS 3] NCName
  7684.           ::= (Letter | '_') (NCNameChar)*  [NS 4] NCNameChar ::=
  7685.            Letter | Digit | '.' | '-' | '_' | CombiningChar | Extender """
  7686.         ret = libxml2mod.xmlXPathParseNCName(self._o)
  7687.         return ret
  7688.  
  7689.     def xpathParseName(self):
  7690.         """parse an XML name  [4] NameChar ::= Letter | Digit | '.' |
  7691.           '-' | '_' | ':' | CombiningChar | Extender  [5] Name ::=
  7692.            (Letter | '_' | ':') (NameChar)* """
  7693.         ret = libxml2mod.xmlXPathParseName(self._o)
  7694.         return ret
  7695.  
  7696.     def xpathPopBoolean(self):
  7697.         """Pops a boolean from the stack, handling conversion if
  7698.            needed. Check error with #xmlXPathCheckError. """
  7699.         ret = libxml2mod.xmlXPathPopBoolean(self._o)
  7700.         return ret
  7701.  
  7702.     def xpathPopNumber(self):
  7703.         """Pops a number from the stack, handling conversion if
  7704.            needed. Check error with #xmlXPathCheckError. """
  7705.         ret = libxml2mod.xmlXPathPopNumber(self._o)
  7706.         return ret
  7707.  
  7708.     def xpathPopString(self):
  7709.         """Pops a string from the stack, handling conversion if
  7710.            needed. Check error with #xmlXPathCheckError. """
  7711.         ret = libxml2mod.xmlXPathPopString(self._o)
  7712.         return ret
  7713.  
  7714.     def xpathPositionFunction(self, nargs):
  7715.         """Implement the position() XPath function number position()
  7716.           The position function returns the position of the context
  7717.           node in the context node list. The first position is 1, and
  7718.            so the last position will be equal to last(). """
  7719.         libxml2mod.xmlXPathPositionFunction(self._o, nargs)
  7720.  
  7721.     def xpathRoot(self):
  7722.         """Initialize the context to the root of the document """
  7723.         libxml2mod.xmlXPathRoot(self._o)
  7724.  
  7725.     def xpathRoundFunction(self, nargs):
  7726.         """Implement the round() XPath function number round(number)
  7727.           The round function returns the number that is closest to
  7728.           the argument and that is an integer. If there are two such
  7729.            numbers, then the one that is even is returned. """
  7730.         libxml2mod.xmlXPathRoundFunction(self._o, nargs)
  7731.  
  7732.     def xpathStartsWithFunction(self, nargs):
  7733.         """Implement the starts-with() XPath function boolean
  7734.           starts-with(string, string) The starts-with function
  7735.           returns true if the first argument string starts with the
  7736.            second argument string, and otherwise returns false. """
  7737.         libxml2mod.xmlXPathStartsWithFunction(self._o, nargs)
  7738.  
  7739.     def xpathStringFunction(self, nargs):
  7740.         """Implement the string() XPath function string
  7741.           string(object?) The string function converts an object to a
  7742.           string as follows: - A node-set is converted to a string by
  7743.           returning the value of the node in the node-set that is
  7744.           first in document order. If the node-set is empty, an empty
  7745.           string is returned. - A number is converted to a string as
  7746.           follows + NaN is converted to the string NaN + positive
  7747.           zero is converted to the string 0 + negative zero is
  7748.           converted to the string 0 + positive infinity is converted
  7749.           to the string Infinity + negative infinity is converted to
  7750.           the string -Infinity + if the number is an integer, the
  7751.           number is represented in decimal form as a Number with no
  7752.           decimal point and no leading zeros, preceded by a minus
  7753.           sign (-) if the number is negative + otherwise, the number
  7754.           is represented in decimal form as a Number including a
  7755.           decimal point with at least one digit before the decimal
  7756.           point and at least one digit after the decimal point,
  7757.           preceded by a minus sign (-) if the number is negative;
  7758.           there must be no leading zeros before the decimal point
  7759.           apart possibly from the one required digit immediately
  7760.           before the decimal point; beyond the one required digit
  7761.           after the decimal point there must be as many, but only as
  7762.           many, more digits as are needed to uniquely distinguish the
  7763.           number from all other IEEE 754 numeric values. - The
  7764.           boolean false value is converted to the string false. The
  7765.           boolean true value is converted to the string true.  If the
  7766.           argument is omitted, it defaults to a node-set with the
  7767.            context node as its only member. """
  7768.         libxml2mod.xmlXPathStringFunction(self._o, nargs)
  7769.  
  7770.     def xpathStringLengthFunction(self, nargs):
  7771.         """Implement the string-length() XPath function number
  7772.           string-length(string?) The string-length returns the number
  7773.           of characters in the string (see [3.6 Strings]). If the
  7774.           argument is omitted, it defaults to the context node
  7775.           converted to a string, in other words the value of the
  7776.            context node. """
  7777.         libxml2mod.xmlXPathStringLengthFunction(self._o, nargs)
  7778.  
  7779.     def xpathSubValues(self):
  7780.         """Implement the subtraction operation on XPath objects: The
  7781.           numeric operators convert their operands to numbers as if
  7782.            by calling the number function. """
  7783.         libxml2mod.xmlXPathSubValues(self._o)
  7784.  
  7785.     def xpathSubstringAfterFunction(self, nargs):
  7786.         """Implement the substring-after() XPath function string
  7787.           substring-after(string, string) The substring-after
  7788.           function returns the substring of the first argument string
  7789.           that follows the first occurrence of the second argument
  7790.           string in the first argument string, or the empty stringi
  7791.           if the first argument string does not contain the second
  7792.           argument string. For example,
  7793.           substring-after("1999/04/01","/") returns 04/01, and
  7794.            substring-after("1999/04/01","19") returns 99/04/01. """
  7795.         libxml2mod.xmlXPathSubstringAfterFunction(self._o, nargs)
  7796.  
  7797.     def xpathSubstringBeforeFunction(self, nargs):
  7798.         """Implement the substring-before() XPath function string
  7799.           substring-before(string, string) The substring-before
  7800.           function returns the substring of the first argument string
  7801.           that precedes the first occurrence of the second argument
  7802.           string in the first argument string, or the empty string if
  7803.           the first argument string does not contain the second
  7804.           argument string. For example,
  7805.            substring-before("1999/04/01","/") returns 1999. """
  7806.         libxml2mod.xmlXPathSubstringBeforeFunction(self._o, nargs)
  7807.  
  7808.     def xpathSubstringFunction(self, nargs):
  7809.         """Implement the substring() XPath function string
  7810.           substring(string, number, number?) The substring function
  7811.           returns the substring of the first argument starting at the
  7812.           position specified in the second argument with length
  7813.           specified in the third argument. For example,
  7814.           substring("12345",2,3) returns "234". If the third argument
  7815.           is not specified, it returns the substring starting at the
  7816.           position specified in the second argument and continuing to
  7817.           the end of the string. For example, substring("12345",2)
  7818.           returns "2345".  More precisely, each character in the
  7819.           string (see [3.6 Strings]) is considered to have a numeric
  7820.           position: the position of the first character is 1, the
  7821.           position of the second character is 2 and so on. The
  7822.           returned substring contains those characters for which the
  7823.           position of the character is greater than or equal to the
  7824.           second argument and, if the third argument is specified,
  7825.           less than the sum of the second and third arguments; the
  7826.           comparisons and addition used for the above follow the
  7827.           standard IEEE 754 rules. Thus: - substring("12345", 1.5,
  7828.           2.6) returns "234" - substring("12345", 0, 3) returns "12"
  7829.           - substring("12345", 0 div 0, 3) returns "" -
  7830.           substring("12345", 1, 0 div 0) returns "" -
  7831.           substring("12345", -42, 1 div 0) returns "12345" -
  7832.            substring("12345", -1 div 0, 1 div 0) returns "" """
  7833.         libxml2mod.xmlXPathSubstringFunction(self._o, nargs)
  7834.  
  7835.     def xpathSumFunction(self, nargs):
  7836.         """Implement the sum() XPath function number sum(node-set) The
  7837.           sum function returns the sum of the values of the nodes in
  7838.            the argument node-set. """
  7839.         libxml2mod.xmlXPathSumFunction(self._o, nargs)
  7840.  
  7841.     def xpathTranslateFunction(self, nargs):
  7842.         """Implement the translate() XPath function string
  7843.           translate(string, string, string) The translate function
  7844.           returns the first argument string with occurrences of
  7845.           characters in the second argument string replaced by the
  7846.           character at the corresponding position in the third
  7847.           argument string. For example, translate("bar","abc","ABC")
  7848.           returns the string BAr. If there is a character in the
  7849.           second argument string with no character at a corresponding
  7850.           position in the third argument string (because the second
  7851.           argument string is longer than the third argument string),
  7852.           then occurrences of that character in the first argument
  7853.           string are removed. For example,
  7854.            translate("--aaa--","abc-","ABC") """
  7855.         libxml2mod.xmlXPathTranslateFunction(self._o, nargs)
  7856.  
  7857.     def xpathTrueFunction(self, nargs):
  7858.         """Implement the true() XPath function boolean true() """
  7859.         libxml2mod.xmlXPathTrueFunction(self._o, nargs)
  7860.  
  7861.     def xpathValueFlipSign(self):
  7862.         """Implement the unary - operation on an XPath object The
  7863.           numeric operators convert their operands to numbers as if
  7864.            by calling the number function. """
  7865.         libxml2mod.xmlXPathValueFlipSign(self._o)
  7866.  
  7867.     def xpatherror(self, file, line, no):
  7868.         """Formats an error message. """
  7869.         libxml2mod.xmlXPatherror(self._o, file, line, no)
  7870.  
  7871.     #
  7872.     # xpathParserContext functions from module xpointer
  7873.     #
  7874.  
  7875.     def xpointerEvalRangePredicate(self):
  7876.         """[8]   Predicate ::=   '[' PredicateExpr ']' [9]  
  7877.           PredicateExpr ::=   Expr  Evaluate a predicate as in
  7878.           xmlXPathEvalPredicate() but for a Location Set instead of a
  7879.            node set """
  7880.         libxml2mod.xmlXPtrEvalRangePredicate(self._o)
  7881.  
  7882.     def xpointerRangeToFunction(self, nargs):
  7883.         """Implement the range-to() XPointer function """
  7884.         libxml2mod.xmlXPtrRangeToFunction(self._o, nargs)
  7885.  
  7886. # xlinkShow
  7887. XLINK_SHOW_NONE = 0
  7888. XLINK_SHOW_NEW = 1
  7889. XLINK_SHOW_EMBED = 2
  7890. XLINK_SHOW_REPLACE = 3
  7891.  
  7892. # xmlRelaxNGParserFlag
  7893. XML_RELAXNGP_NONE = 0
  7894. XML_RELAXNGP_FREE_DOC = 1
  7895. XML_RELAXNGP_CRNG = 2
  7896.  
  7897. # xmlBufferAllocationScheme
  7898. XML_BUFFER_ALLOC_DOUBLEIT = 1
  7899. XML_BUFFER_ALLOC_EXACT = 2
  7900. XML_BUFFER_ALLOC_IMMUTABLE = 3
  7901. XML_BUFFER_ALLOC_IO = 4
  7902.  
  7903. # xmlParserSeverities
  7904. XML_PARSER_SEVERITY_VALIDITY_WARNING = 1
  7905. XML_PARSER_SEVERITY_VALIDITY_ERROR = 2
  7906. XML_PARSER_SEVERITY_WARNING = 3
  7907. XML_PARSER_SEVERITY_ERROR = 4
  7908.  
  7909. # xmlAttributeDefault
  7910. XML_ATTRIBUTE_NONE = 1
  7911. XML_ATTRIBUTE_REQUIRED = 2
  7912. XML_ATTRIBUTE_IMPLIED = 3
  7913. XML_ATTRIBUTE_FIXED = 4
  7914.  
  7915. # xmlSchemaValType
  7916. XML_SCHEMAS_UNKNOWN = 0
  7917. XML_SCHEMAS_STRING = 1
  7918. XML_SCHEMAS_NORMSTRING = 2
  7919. XML_SCHEMAS_DECIMAL = 3
  7920. XML_SCHEMAS_TIME = 4
  7921. XML_SCHEMAS_GDAY = 5
  7922. XML_SCHEMAS_GMONTH = 6
  7923. XML_SCHEMAS_GMONTHDAY = 7
  7924. XML_SCHEMAS_GYEAR = 8
  7925. XML_SCHEMAS_GYEARMONTH = 9
  7926. XML_SCHEMAS_DATE = 10
  7927. XML_SCHEMAS_DATETIME = 11
  7928. XML_SCHEMAS_DURATION = 12
  7929. XML_SCHEMAS_FLOAT = 13
  7930. XML_SCHEMAS_DOUBLE = 14
  7931. XML_SCHEMAS_BOOLEAN = 15
  7932. XML_SCHEMAS_TOKEN = 16
  7933. XML_SCHEMAS_LANGUAGE = 17
  7934. XML_SCHEMAS_NMTOKEN = 18
  7935. XML_SCHEMAS_NMTOKENS = 19
  7936. XML_SCHEMAS_NAME = 20
  7937. XML_SCHEMAS_QNAME = 21
  7938. XML_SCHEMAS_NCNAME = 22
  7939. XML_SCHEMAS_ID = 23
  7940. XML_SCHEMAS_IDREF = 24
  7941. XML_SCHEMAS_IDREFS = 25
  7942. XML_SCHEMAS_ENTITY = 26
  7943. XML_SCHEMAS_ENTITIES = 27
  7944. XML_SCHEMAS_NOTATION = 28
  7945. XML_SCHEMAS_ANYURI = 29
  7946. XML_SCHEMAS_INTEGER = 30
  7947. XML_SCHEMAS_NPINTEGER = 31
  7948. XML_SCHEMAS_NINTEGER = 32
  7949. XML_SCHEMAS_NNINTEGER = 33
  7950. XML_SCHEMAS_PINTEGER = 34
  7951. XML_SCHEMAS_INT = 35
  7952. XML_SCHEMAS_UINT = 36
  7953. XML_SCHEMAS_LONG = 37
  7954. XML_SCHEMAS_ULONG = 38
  7955. XML_SCHEMAS_SHORT = 39
  7956. XML_SCHEMAS_USHORT = 40
  7957. XML_SCHEMAS_BYTE = 41
  7958. XML_SCHEMAS_UBYTE = 42
  7959. XML_SCHEMAS_HEXBINARY = 43
  7960. XML_SCHEMAS_BASE64BINARY = 44
  7961. XML_SCHEMAS_ANYTYPE = 45
  7962. XML_SCHEMAS_ANYSIMPLETYPE = 46
  7963.  
  7964. # xmlParserInputState
  7965. XML_PARSER_EOF = -1
  7966. XML_PARSER_START = 0
  7967. XML_PARSER_MISC = 1
  7968. XML_PARSER_PI = 2
  7969. XML_PARSER_DTD = 3
  7970. XML_PARSER_PROLOG = 4
  7971. XML_PARSER_COMMENT = 5
  7972. XML_PARSER_START_TAG = 6
  7973. XML_PARSER_CONTENT = 7
  7974. XML_PARSER_CDATA_SECTION = 8
  7975. XML_PARSER_END_TAG = 9
  7976. XML_PARSER_ENTITY_DECL = 10
  7977. XML_PARSER_ENTITY_VALUE = 11
  7978. XML_PARSER_ATTRIBUTE_VALUE = 12
  7979. XML_PARSER_SYSTEM_LITERAL = 13
  7980. XML_PARSER_EPILOG = 14
  7981. XML_PARSER_IGNORE = 15
  7982. XML_PARSER_PUBLIC_LITERAL = 16
  7983.  
  7984. # xmlEntityType
  7985. XML_INTERNAL_GENERAL_ENTITY = 1
  7986. XML_EXTERNAL_GENERAL_PARSED_ENTITY = 2
  7987. XML_EXTERNAL_GENERAL_UNPARSED_ENTITY = 3
  7988. XML_INTERNAL_PARAMETER_ENTITY = 4
  7989. XML_EXTERNAL_PARAMETER_ENTITY = 5
  7990. XML_INTERNAL_PREDEFINED_ENTITY = 6
  7991.  
  7992. # xmlSaveOption
  7993. XML_SAVE_FORMAT = 1
  7994. XML_SAVE_NO_DECL = 2
  7995. XML_SAVE_NO_EMPTY = 4
  7996. XML_SAVE_NO_XHTML = 8
  7997. XML_SAVE_XHTML = 16
  7998. XML_SAVE_AS_XML = 32
  7999. XML_SAVE_AS_HTML = 64
  8000. XML_SAVE_WSNONSIG = 128
  8001.  
  8002. # xmlPatternFlags
  8003. XML_PATTERN_DEFAULT = 0
  8004. XML_PATTERN_XPATH = 1
  8005. XML_PATTERN_XSSEL = 2
  8006. XML_PATTERN_XSFIELD = 4
  8007.  
  8008. # xmlParserErrors
  8009. XML_ERR_OK = 0
  8010. XML_ERR_INTERNAL_ERROR = 1
  8011. XML_ERR_NO_MEMORY = 2
  8012. XML_ERR_DOCUMENT_START = 3
  8013. XML_ERR_DOCUMENT_EMPTY = 4
  8014. XML_ERR_DOCUMENT_END = 5
  8015. XML_ERR_INVALID_HEX_CHARREF = 6
  8016. XML_ERR_INVALID_DEC_CHARREF = 7
  8017. XML_ERR_INVALID_CHARREF = 8
  8018. XML_ERR_INVALID_CHAR = 9
  8019. XML_ERR_CHARREF_AT_EOF = 10
  8020. XML_ERR_CHARREF_IN_PROLOG = 11
  8021. XML_ERR_CHARREF_IN_EPILOG = 12
  8022. XML_ERR_CHARREF_IN_DTD = 13
  8023. XML_ERR_ENTITYREF_AT_EOF = 14
  8024. XML_ERR_ENTITYREF_IN_PROLOG = 15
  8025. XML_ERR_ENTITYREF_IN_EPILOG = 16
  8026. XML_ERR_ENTITYREF_IN_DTD = 17
  8027. XML_ERR_PEREF_AT_EOF = 18
  8028. XML_ERR_PEREF_IN_PROLOG = 19
  8029. XML_ERR_PEREF_IN_EPILOG = 20
  8030. XML_ERR_PEREF_IN_INT_SUBSET = 21
  8031. XML_ERR_ENTITYREF_NO_NAME = 22
  8032. XML_ERR_ENTITYREF_SEMICOL_MISSING = 23
  8033. XML_ERR_PEREF_NO_NAME = 24
  8034. XML_ERR_PEREF_SEMICOL_MISSING = 25
  8035. XML_ERR_UNDECLARED_ENTITY = 26
  8036. XML_WAR_UNDECLARED_ENTITY = 27
  8037. XML_ERR_UNPARSED_ENTITY = 28
  8038. XML_ERR_ENTITY_IS_EXTERNAL = 29
  8039. XML_ERR_ENTITY_IS_PARAMETER = 30
  8040. XML_ERR_UNKNOWN_ENCODING = 31
  8041. XML_ERR_UNSUPPORTED_ENCODING = 32
  8042. XML_ERR_STRING_NOT_STARTED = 33
  8043. XML_ERR_STRING_NOT_CLOSED = 34
  8044. XML_ERR_NS_DECL_ERROR = 35
  8045. XML_ERR_ENTITY_NOT_STARTED = 36
  8046. XML_ERR_ENTITY_NOT_FINISHED = 37
  8047. XML_ERR_LT_IN_ATTRIBUTE = 38
  8048. XML_ERR_ATTRIBUTE_NOT_STARTED = 39
  8049. XML_ERR_ATTRIBUTE_NOT_FINISHED = 40
  8050. XML_ERR_ATTRIBUTE_WITHOUT_VALUE = 41
  8051. XML_ERR_ATTRIBUTE_REDEFINED = 42
  8052. XML_ERR_LITERAL_NOT_STARTED = 43
  8053. XML_ERR_LITERAL_NOT_FINISHED = 44
  8054. XML_ERR_COMMENT_NOT_FINISHED = 45
  8055. XML_ERR_PI_NOT_STARTED = 46
  8056. XML_ERR_PI_NOT_FINISHED = 47
  8057. XML_ERR_NOTATION_NOT_STARTED = 48
  8058. XML_ERR_NOTATION_NOT_FINISHED = 49
  8059. XML_ERR_ATTLIST_NOT_STARTED = 50
  8060. XML_ERR_ATTLIST_NOT_FINISHED = 51
  8061. XML_ERR_MIXED_NOT_STARTED = 52
  8062. XML_ERR_MIXED_NOT_FINISHED = 53
  8063. XML_ERR_ELEMCONTENT_NOT_STARTED = 54
  8064. XML_ERR_ELEMCONTENT_NOT_FINISHED = 55
  8065. XML_ERR_XMLDECL_NOT_STARTED = 56
  8066. XML_ERR_XMLDECL_NOT_FINISHED = 57
  8067. XML_ERR_CONDSEC_NOT_STARTED = 58
  8068. XML_ERR_CONDSEC_NOT_FINISHED = 59
  8069. XML_ERR_EXT_SUBSET_NOT_FINISHED = 60
  8070. XML_ERR_DOCTYPE_NOT_FINISHED = 61
  8071. XML_ERR_MISPLACED_CDATA_END = 62
  8072. XML_ERR_CDATA_NOT_FINISHED = 63
  8073. XML_ERR_RESERVED_XML_NAME = 64
  8074. XML_ERR_SPACE_REQUIRED = 65
  8075. XML_ERR_SEPARATOR_REQUIRED = 66
  8076. XML_ERR_NMTOKEN_REQUIRED = 67
  8077. XML_ERR_NAME_REQUIRED = 68
  8078. XML_ERR_PCDATA_REQUIRED = 69
  8079. XML_ERR_URI_REQUIRED = 70
  8080. XML_ERR_PUBID_REQUIRED = 71
  8081. XML_ERR_LT_REQUIRED = 72
  8082. XML_ERR_GT_REQUIRED = 73
  8083. XML_ERR_LTSLASH_REQUIRED = 74
  8084. XML_ERR_EQUAL_REQUIRED = 75
  8085. XML_ERR_TAG_NAME_MISMATCH = 76
  8086. XML_ERR_TAG_NOT_FINISHED = 77
  8087. XML_ERR_STANDALONE_VALUE = 78
  8088. XML_ERR_ENCODING_NAME = 79
  8089. XML_ERR_HYPHEN_IN_COMMENT = 80
  8090. XML_ERR_INVALID_ENCODING = 81
  8091. XML_ERR_EXT_ENTITY_STANDALONE = 82
  8092. XML_ERR_CONDSEC_INVALID = 83
  8093. XML_ERR_VALUE_REQUIRED = 84
  8094. XML_ERR_NOT_WELL_BALANCED = 85
  8095. XML_ERR_EXTRA_CONTENT = 86
  8096. XML_ERR_ENTITY_CHAR_ERROR = 87
  8097. XML_ERR_ENTITY_PE_INTERNAL = 88
  8098. XML_ERR_ENTITY_LOOP = 89
  8099. XML_ERR_ENTITY_BOUNDARY = 90
  8100. XML_ERR_INVALID_URI = 91
  8101. XML_ERR_URI_FRAGMENT = 92
  8102. XML_WAR_CATALOG_PI = 93
  8103. XML_ERR_NO_DTD = 94
  8104. XML_ERR_CONDSEC_INVALID_KEYWORD = 95
  8105. XML_ERR_VERSION_MISSING = 96
  8106. XML_WAR_UNKNOWN_VERSION = 97
  8107. XML_WAR_LANG_VALUE = 98
  8108. XML_WAR_NS_URI = 99
  8109. XML_WAR_NS_URI_RELATIVE = 100
  8110. XML_ERR_MISSING_ENCODING = 101
  8111. XML_WAR_SPACE_VALUE = 102
  8112. XML_ERR_NOT_STANDALONE = 103
  8113. XML_ERR_ENTITY_PROCESSING = 104
  8114. XML_ERR_NOTATION_PROCESSING = 105
  8115. XML_WAR_NS_COLUMN = 106
  8116. XML_WAR_ENTITY_REDEFINED = 107
  8117. XML_ERR_UNKNOWN_VERSION = 108
  8118. XML_ERR_VERSION_MISMATCH = 109
  8119. XML_NS_ERR_XML_NAMESPACE = 200
  8120. XML_NS_ERR_UNDEFINED_NAMESPACE = 201
  8121. XML_NS_ERR_QNAME = 202
  8122. XML_NS_ERR_ATTRIBUTE_REDEFINED = 203
  8123. XML_NS_ERR_EMPTY = 204
  8124. XML_NS_ERR_COLON = 205
  8125. XML_DTD_ATTRIBUTE_DEFAULT = 500
  8126. XML_DTD_ATTRIBUTE_REDEFINED = 501
  8127. XML_DTD_ATTRIBUTE_VALUE = 502
  8128. XML_DTD_CONTENT_ERROR = 503
  8129. XML_DTD_CONTENT_MODEL = 504
  8130. XML_DTD_CONTENT_NOT_DETERMINIST = 505
  8131. XML_DTD_DIFFERENT_PREFIX = 506
  8132. XML_DTD_ELEM_DEFAULT_NAMESPACE = 507
  8133. XML_DTD_ELEM_NAMESPACE = 508
  8134. XML_DTD_ELEM_REDEFINED = 509
  8135. XML_DTD_EMPTY_NOTATION = 510
  8136. XML_DTD_ENTITY_TYPE = 511
  8137. XML_DTD_ID_FIXED = 512
  8138. XML_DTD_ID_REDEFINED = 513
  8139. XML_DTD_ID_SUBSET = 514
  8140. XML_DTD_INVALID_CHILD = 515
  8141. XML_DTD_INVALID_DEFAULT = 516
  8142. XML_DTD_LOAD_ERROR = 517
  8143. XML_DTD_MISSING_ATTRIBUTE = 518
  8144. XML_DTD_MIXED_CORRUPT = 519
  8145. XML_DTD_MULTIPLE_ID = 520
  8146. XML_DTD_NO_DOC = 521
  8147. XML_DTD_NO_DTD = 522
  8148. XML_DTD_NO_ELEM_NAME = 523
  8149. XML_DTD_NO_PREFIX = 524
  8150. XML_DTD_NO_ROOT = 525
  8151. XML_DTD_NOTATION_REDEFINED = 526
  8152. XML_DTD_NOTATION_VALUE = 527
  8153. XML_DTD_NOT_EMPTY = 528
  8154. XML_DTD_NOT_PCDATA = 529
  8155. XML_DTD_NOT_STANDALONE = 530
  8156. XML_DTD_ROOT_NAME = 531
  8157. XML_DTD_STANDALONE_WHITE_SPACE = 532
  8158. XML_DTD_UNKNOWN_ATTRIBUTE = 533
  8159. XML_DTD_UNKNOWN_ELEM = 534
  8160. XML_DTD_UNKNOWN_ENTITY = 535
  8161. XML_DTD_UNKNOWN_ID = 536
  8162. XML_DTD_UNKNOWN_NOTATION = 537
  8163. XML_DTD_STANDALONE_DEFAULTED = 538
  8164. XML_DTD_XMLID_VALUE = 539
  8165. XML_DTD_XMLID_TYPE = 540
  8166. XML_DTD_DUP_TOKEN = 541
  8167. XML_HTML_STRUCURE_ERROR = 800
  8168. XML_HTML_UNKNOWN_TAG = 801
  8169. XML_RNGP_ANYNAME_ATTR_ANCESTOR = 1000
  8170. XML_RNGP_ATTR_CONFLICT = 1001
  8171. XML_RNGP_ATTRIBUTE_CHILDREN = 1002
  8172. XML_RNGP_ATTRIBUTE_CONTENT = 1003
  8173. XML_RNGP_ATTRIBUTE_EMPTY = 1004
  8174. XML_RNGP_ATTRIBUTE_NOOP = 1005
  8175. XML_RNGP_CHOICE_CONTENT = 1006
  8176. XML_RNGP_CHOICE_EMPTY = 1007
  8177. XML_RNGP_CREATE_FAILURE = 1008
  8178. XML_RNGP_DATA_CONTENT = 1009
  8179. XML_RNGP_DEF_CHOICE_AND_INTERLEAVE = 1010
  8180. XML_RNGP_DEFINE_CREATE_FAILED = 1011
  8181. XML_RNGP_DEFINE_EMPTY = 1012
  8182. XML_RNGP_DEFINE_MISSING = 1013
  8183. XML_RNGP_DEFINE_NAME_MISSING = 1014
  8184. XML_RNGP_ELEM_CONTENT_EMPTY = 1015
  8185. XML_RNGP_ELEM_CONTENT_ERROR = 1016
  8186. XML_RNGP_ELEMENT_EMPTY = 1017
  8187. XML_RNGP_ELEMENT_CONTENT = 1018
  8188. XML_RNGP_ELEMENT_NAME = 1019
  8189. XML_RNGP_ELEMENT_NO_CONTENT = 1020
  8190. XML_RNGP_ELEM_TEXT_CONFLICT = 1021
  8191. XML_RNGP_EMPTY = 1022
  8192. XML_RNGP_EMPTY_CONSTRUCT = 1023
  8193. XML_RNGP_EMPTY_CONTENT = 1024
  8194. XML_RNGP_EMPTY_NOT_EMPTY = 1025
  8195. XML_RNGP_ERROR_TYPE_LIB = 1026
  8196. XML_RNGP_EXCEPT_EMPTY = 1027
  8197. XML_RNGP_EXCEPT_MISSING = 1028
  8198. XML_RNGP_EXCEPT_MULTIPLE = 1029
  8199. XML_RNGP_EXCEPT_NO_CONTENT = 1030
  8200. XML_RNGP_EXTERNALREF_EMTPY = 1031
  8201. XML_RNGP_EXTERNAL_REF_FAILURE = 1032
  8202. XML_RNGP_EXTERNALREF_RECURSE = 1033
  8203. XML_RNGP_FORBIDDEN_ATTRIBUTE = 1034
  8204. XML_RNGP_FOREIGN_ELEMENT = 1035
  8205. XML_RNGP_GRAMMAR_CONTENT = 1036
  8206. XML_RNGP_GRAMMAR_EMPTY = 1037
  8207. XML_RNGP_GRAMMAR_MISSING = 1038
  8208. XML_RNGP_GRAMMAR_NO_START = 1039
  8209. XML_RNGP_GROUP_ATTR_CONFLICT = 1040
  8210. XML_RNGP_HREF_ERROR = 1041
  8211. XML_RNGP_INCLUDE_EMPTY = 1042
  8212. XML_RNGP_INCLUDE_FAILURE = 1043
  8213. XML_RNGP_INCLUDE_RECURSE = 1044
  8214. XML_RNGP_INTERLEAVE_ADD = 1045
  8215. XML_RNGP_INTERLEAVE_CREATE_FAILED = 1046
  8216. XML_RNGP_INTERLEAVE_EMPTY = 1047
  8217. XML_RNGP_INTERLEAVE_NO_CONTENT = 1048
  8218. XML_RNGP_INVALID_DEFINE_NAME = 1049
  8219. XML_RNGP_INVALID_URI = 1050
  8220. XML_RNGP_INVALID_VALUE = 1051
  8221. XML_RNGP_MISSING_HREF = 1052
  8222. XML_RNGP_NAME_MISSING = 1053
  8223. XML_RNGP_NEED_COMBINE = 1054
  8224. XML_RNGP_NOTALLOWED_NOT_EMPTY = 1055
  8225. XML_RNGP_NSNAME_ATTR_ANCESTOR = 1056
  8226. XML_RNGP_NSNAME_NO_NS = 1057
  8227. XML_RNGP_PARAM_FORBIDDEN = 1058
  8228. XML_RNGP_PARAM_NAME_MISSING = 1059
  8229. XML_RNGP_PARENTREF_CREATE_FAILED = 1060
  8230. XML_RNGP_PARENTREF_NAME_INVALID = 1061
  8231. XML_RNGP_PARENTREF_NO_NAME = 1062
  8232. XML_RNGP_PARENTREF_NO_PARENT = 1063
  8233. XML_RNGP_PARENTREF_NOT_EMPTY = 1064
  8234. XML_RNGP_PARSE_ERROR = 1065
  8235. XML_RNGP_PAT_ANYNAME_EXCEPT_ANYNAME = 1066
  8236. XML_RNGP_PAT_ATTR_ATTR = 1067
  8237. XML_RNGP_PAT_ATTR_ELEM = 1068
  8238. XML_RNGP_PAT_DATA_EXCEPT_ATTR = 1069
  8239. XML_RNGP_PAT_DATA_EXCEPT_ELEM = 1070
  8240. XML_RNGP_PAT_DATA_EXCEPT_EMPTY = 1071
  8241. XML_RNGP_PAT_DATA_EXCEPT_GROUP = 1072
  8242. XML_RNGP_PAT_DATA_EXCEPT_INTERLEAVE = 1073
  8243. XML_RNGP_PAT_DATA_EXCEPT_LIST = 1074
  8244. XML_RNGP_PAT_DATA_EXCEPT_ONEMORE = 1075
  8245. XML_RNGP_PAT_DATA_EXCEPT_REF = 1076
  8246. XML_RNGP_PAT_DATA_EXCEPT_TEXT = 1077
  8247. XML_RNGP_PAT_LIST_ATTR = 1078
  8248. XML_RNGP_PAT_LIST_ELEM = 1079
  8249. XML_RNGP_PAT_LIST_INTERLEAVE = 1080
  8250. XML_RNGP_PAT_LIST_LIST = 1081
  8251. XML_RNGP_PAT_LIST_REF = 1082
  8252. XML_RNGP_PAT_LIST_TEXT = 1083
  8253. XML_RNGP_PAT_NSNAME_EXCEPT_ANYNAME = 1084
  8254. XML_RNGP_PAT_NSNAME_EXCEPT_NSNAME = 1085
  8255. XML_RNGP_PAT_ONEMORE_GROUP_ATTR = 1086
  8256. XML_RNGP_PAT_ONEMORE_INTERLEAVE_ATTR = 1087
  8257. XML_RNGP_PAT_START_ATTR = 1088
  8258. XML_RNGP_PAT_START_DATA = 1089
  8259. XML_RNGP_PAT_START_EMPTY = 1090
  8260. XML_RNGP_PAT_START_GROUP = 1091
  8261. XML_RNGP_PAT_START_INTERLEAVE = 1092
  8262. XML_RNGP_PAT_START_LIST = 1093
  8263. XML_RNGP_PAT_START_ONEMORE = 1094
  8264. XML_RNGP_PAT_START_TEXT = 1095
  8265. XML_RNGP_PAT_START_VALUE = 1096
  8266. XML_RNGP_PREFIX_UNDEFINED = 1097
  8267. XML_RNGP_REF_CREATE_FAILED = 1098
  8268. XML_RNGP_REF_CYCLE = 1099
  8269. XML_RNGP_REF_NAME_INVALID = 1100
  8270. XML_RNGP_REF_NO_DEF = 1101
  8271. XML_RNGP_REF_NO_NAME = 1102
  8272. XML_RNGP_REF_NOT_EMPTY = 1103
  8273. XML_RNGP_START_CHOICE_AND_INTERLEAVE = 1104
  8274. XML_RNGP_START_CONTENT = 1105
  8275. XML_RNGP_START_EMPTY = 1106
  8276. XML_RNGP_START_MISSING = 1107
  8277. XML_RNGP_TEXT_EXPECTED = 1108
  8278. XML_RNGP_TEXT_HAS_CHILD = 1109
  8279. XML_RNGP_TYPE_MISSING = 1110
  8280. XML_RNGP_TYPE_NOT_FOUND = 1111
  8281. XML_RNGP_TYPE_VALUE = 1112
  8282. XML_RNGP_UNKNOWN_ATTRIBUTE = 1113
  8283. XML_RNGP_UNKNOWN_COMBINE = 1114
  8284. XML_RNGP_UNKNOWN_CONSTRUCT = 1115
  8285. XML_RNGP_UNKNOWN_TYPE_LIB = 1116
  8286. XML_RNGP_URI_FRAGMENT = 1117
  8287. XML_RNGP_URI_NOT_ABSOLUTE = 1118
  8288. XML_RNGP_VALUE_EMPTY = 1119
  8289. XML_RNGP_VALUE_NO_CONTENT = 1120
  8290. XML_RNGP_XMLNS_NAME = 1121
  8291. XML_RNGP_XML_NS = 1122
  8292. XML_XPATH_EXPRESSION_OK = 1200
  8293. XML_XPATH_NUMBER_ERROR = 1201
  8294. XML_XPATH_UNFINISHED_LITERAL_ERROR = 1202
  8295. XML_XPATH_START_LITERAL_ERROR = 1203
  8296. XML_XPATH_VARIABLE_REF_ERROR = 1204
  8297. XML_XPATH_UNDEF_VARIABLE_ERROR = 1205
  8298. XML_XPATH_INVALID_PREDICATE_ERROR = 1206
  8299. XML_XPATH_EXPR_ERROR = 1207
  8300. XML_XPATH_UNCLOSED_ERROR = 1208
  8301. XML_XPATH_UNKNOWN_FUNC_ERROR = 1209
  8302. XML_XPATH_INVALID_OPERAND = 1210
  8303. XML_XPATH_INVALID_TYPE = 1211
  8304. XML_XPATH_INVALID_ARITY = 1212
  8305. XML_XPATH_INVALID_CTXT_SIZE = 1213
  8306. XML_XPATH_INVALID_CTXT_POSITION = 1214
  8307. XML_XPATH_MEMORY_ERROR = 1215
  8308. XML_XPTR_SYNTAX_ERROR = 1216
  8309. XML_XPTR_RESOURCE_ERROR = 1217
  8310. XML_XPTR_SUB_RESOURCE_ERROR = 1218
  8311. XML_XPATH_UNDEF_PREFIX_ERROR = 1219
  8312. XML_XPATH_ENCODING_ERROR = 1220
  8313. XML_XPATH_INVALID_CHAR_ERROR = 1221
  8314. XML_TREE_INVALID_HEX = 1300
  8315. XML_TREE_INVALID_DEC = 1301
  8316. XML_TREE_UNTERMINATED_ENTITY = 1302
  8317. XML_TREE_NOT_UTF8 = 1303
  8318. XML_SAVE_NOT_UTF8 = 1400
  8319. XML_SAVE_CHAR_INVALID = 1401
  8320. XML_SAVE_NO_DOCTYPE = 1402
  8321. XML_SAVE_UNKNOWN_ENCODING = 1403
  8322. XML_REGEXP_COMPILE_ERROR = 1450
  8323. XML_IO_UNKNOWN = 1500
  8324. XML_IO_EACCES = 1501
  8325. XML_IO_EAGAIN = 1502
  8326. XML_IO_EBADF = 1503
  8327. XML_IO_EBADMSG = 1504
  8328. XML_IO_EBUSY = 1505
  8329. XML_IO_ECANCELED = 1506
  8330. XML_IO_ECHILD = 1507
  8331. XML_IO_EDEADLK = 1508
  8332. XML_IO_EDOM = 1509
  8333. XML_IO_EEXIST = 1510
  8334. XML_IO_EFAULT = 1511
  8335. XML_IO_EFBIG = 1512
  8336. XML_IO_EINPROGRESS = 1513
  8337. XML_IO_EINTR = 1514
  8338. XML_IO_EINVAL = 1515
  8339. XML_IO_EIO = 1516
  8340. XML_IO_EISDIR = 1517
  8341. XML_IO_EMFILE = 1518
  8342. XML_IO_EMLINK = 1519
  8343. XML_IO_EMSGSIZE = 1520
  8344. XML_IO_ENAMETOOLONG = 1521
  8345. XML_IO_ENFILE = 1522
  8346. XML_IO_ENODEV = 1523
  8347. XML_IO_ENOENT = 1524
  8348. XML_IO_ENOEXEC = 1525
  8349. XML_IO_ENOLCK = 1526
  8350. XML_IO_ENOMEM = 1527
  8351. XML_IO_ENOSPC = 1528
  8352. XML_IO_ENOSYS = 1529
  8353. XML_IO_ENOTDIR = 1530
  8354. XML_IO_ENOTEMPTY = 1531
  8355. XML_IO_ENOTSUP = 1532
  8356. XML_IO_ENOTTY = 1533
  8357. XML_IO_ENXIO = 1534
  8358. XML_IO_EPERM = 1535
  8359. XML_IO_EPIPE = 1536
  8360. XML_IO_ERANGE = 1537
  8361. XML_IO_EROFS = 1538
  8362. XML_IO_ESPIPE = 1539
  8363. XML_IO_ESRCH = 1540
  8364. XML_IO_ETIMEDOUT = 1541
  8365. XML_IO_EXDEV = 1542
  8366. XML_IO_NETWORK_ATTEMPT = 1543
  8367. XML_IO_ENCODER = 1544
  8368. XML_IO_FLUSH = 1545
  8369. XML_IO_WRITE = 1546
  8370. XML_IO_NO_INPUT = 1547
  8371. XML_IO_BUFFER_FULL = 1548
  8372. XML_IO_LOAD_ERROR = 1549
  8373. XML_IO_ENOTSOCK = 1550
  8374. XML_IO_EISCONN = 1551
  8375. XML_IO_ECONNREFUSED = 1552
  8376. XML_IO_ENETUNREACH = 1553
  8377. XML_IO_EADDRINUSE = 1554
  8378. XML_IO_EALREADY = 1555
  8379. XML_IO_EAFNOSUPPORT = 1556
  8380. XML_XINCLUDE_RECURSION = 1600
  8381. XML_XINCLUDE_PARSE_VALUE = 1601
  8382. XML_XINCLUDE_ENTITY_DEF_MISMATCH = 1602
  8383. XML_XINCLUDE_NO_HREF = 1603
  8384. XML_XINCLUDE_NO_FALLBACK = 1604
  8385. XML_XINCLUDE_HREF_URI = 1605
  8386. XML_XINCLUDE_TEXT_FRAGMENT = 1606
  8387. XML_XINCLUDE_TEXT_DOCUMENT = 1607
  8388. XML_XINCLUDE_INVALID_CHAR = 1608
  8389. XML_XINCLUDE_BUILD_FAILED = 1609
  8390. XML_XINCLUDE_UNKNOWN_ENCODING = 1610
  8391. XML_XINCLUDE_MULTIPLE_ROOT = 1611
  8392. XML_XINCLUDE_XPTR_FAILED = 1612
  8393. XML_XINCLUDE_XPTR_RESULT = 1613
  8394. XML_XINCLUDE_INCLUDE_IN_INCLUDE = 1614
  8395. XML_XINCLUDE_FALLBACKS_IN_INCLUDE = 1615
  8396. XML_XINCLUDE_FALLBACK_NOT_IN_INCLUDE = 1616
  8397. XML_XINCLUDE_DEPRECATED_NS = 1617
  8398. XML_XINCLUDE_FRAGMENT_ID = 1618
  8399. XML_CATALOG_MISSING_ATTR = 1650
  8400. XML_CATALOG_ENTRY_BROKEN = 1651
  8401. XML_CATALOG_PREFER_VALUE = 1652
  8402. XML_CATALOG_NOT_CATALOG = 1653
  8403. XML_CATALOG_RECURSION = 1654
  8404. XML_SCHEMAP_PREFIX_UNDEFINED = 1700
  8405. XML_SCHEMAP_ATTRFORMDEFAULT_VALUE = 1701
  8406. XML_SCHEMAP_ATTRGRP_NONAME_NOREF = 1702
  8407. XML_SCHEMAP_ATTR_NONAME_NOREF = 1703
  8408. XML_SCHEMAP_COMPLEXTYPE_NONAME_NOREF = 1704
  8409. XML_SCHEMAP_ELEMFORMDEFAULT_VALUE = 1705
  8410. XML_SCHEMAP_ELEM_NONAME_NOREF = 1706
  8411. XML_SCHEMAP_EXTENSION_NO_BASE = 1707
  8412. XML_SCHEMAP_FACET_NO_VALUE = 1708
  8413. XML_SCHEMAP_FAILED_BUILD_IMPORT = 1709
  8414. XML_SCHEMAP_GROUP_NONAME_NOREF = 1710
  8415. XML_SCHEMAP_IMPORT_NAMESPACE_NOT_URI = 1711
  8416. XML_SCHEMAP_IMPORT_REDEFINE_NSNAME = 1712
  8417. XML_SCHEMAP_IMPORT_SCHEMA_NOT_URI = 1713
  8418. XML_SCHEMAP_INVALID_BOOLEAN = 1714
  8419. XML_SCHEMAP_INVALID_ENUM = 1715
  8420. XML_SCHEMAP_INVALID_FACET = 1716
  8421. XML_SCHEMAP_INVALID_FACET_VALUE = 1717
  8422. XML_SCHEMAP_INVALID_MAXOCCURS = 1718
  8423. XML_SCHEMAP_INVALID_MINOCCURS = 1719
  8424. XML_SCHEMAP_INVALID_REF_AND_SUBTYPE = 1720
  8425. XML_SCHEMAP_INVALID_WHITE_SPACE = 1721
  8426. XML_SCHEMAP_NOATTR_NOREF = 1722
  8427. XML_SCHEMAP_NOTATION_NO_NAME = 1723
  8428. XML_SCHEMAP_NOTYPE_NOREF = 1724
  8429. XML_SCHEMAP_REF_AND_SUBTYPE = 1725
  8430. XML_SCHEMAP_RESTRICTION_NONAME_NOREF = 1726
  8431. XML_SCHEMAP_SIMPLETYPE_NONAME = 1727
  8432. XML_SCHEMAP_TYPE_AND_SUBTYPE = 1728
  8433. XML_SCHEMAP_UNKNOWN_ALL_CHILD = 1729
  8434. XML_SCHEMAP_UNKNOWN_ANYATTRIBUTE_CHILD = 1730
  8435. XML_SCHEMAP_UNKNOWN_ATTR_CHILD = 1731
  8436. XML_SCHEMAP_UNKNOWN_ATTRGRP_CHILD = 1732
  8437. XML_SCHEMAP_UNKNOWN_ATTRIBUTE_GROUP = 1733
  8438. XML_SCHEMAP_UNKNOWN_BASE_TYPE = 1734
  8439. XML_SCHEMAP_UNKNOWN_CHOICE_CHILD = 1735
  8440. XML_SCHEMAP_UNKNOWN_COMPLEXCONTENT_CHILD = 1736
  8441. XML_SCHEMAP_UNKNOWN_COMPLEXTYPE_CHILD = 1737
  8442. XML_SCHEMAP_UNKNOWN_ELEM_CHILD = 1738
  8443. XML_SCHEMAP_UNKNOWN_EXTENSION_CHILD = 1739
  8444. XML_SCHEMAP_UNKNOWN_FACET_CHILD = 1740
  8445. XML_SCHEMAP_UNKNOWN_FACET_TYPE = 1741
  8446. XML_SCHEMAP_UNKNOWN_GROUP_CHILD = 1742
  8447. XML_SCHEMAP_UNKNOWN_IMPORT_CHILD = 1743
  8448. XML_SCHEMAP_UNKNOWN_LIST_CHILD = 1744
  8449. XML_SCHEMAP_UNKNOWN_NOTATION_CHILD = 1745
  8450. XML_SCHEMAP_UNKNOWN_PROCESSCONTENT_CHILD = 1746
  8451. XML_SCHEMAP_UNKNOWN_REF = 1747
  8452. XML_SCHEMAP_UNKNOWN_RESTRICTION_CHILD = 1748
  8453. XML_SCHEMAP_UNKNOWN_SCHEMAS_CHILD = 1749
  8454. XML_SCHEMAP_UNKNOWN_SEQUENCE_CHILD = 1750
  8455. XML_SCHEMAP_UNKNOWN_SIMPLECONTENT_CHILD = 1751
  8456. XML_SCHEMAP_UNKNOWN_SIMPLETYPE_CHILD = 1752
  8457. XML_SCHEMAP_UNKNOWN_TYPE = 1753
  8458. XML_SCHEMAP_UNKNOWN_UNION_CHILD = 1754
  8459. XML_SCHEMAP_ELEM_DEFAULT_FIXED = 1755
  8460. XML_SCHEMAP_REGEXP_INVALID = 1756
  8461. XML_SCHEMAP_FAILED_LOAD = 1757
  8462. XML_SCHEMAP_NOTHING_TO_PARSE = 1758
  8463. XML_SCHEMAP_NOROOT = 1759
  8464. XML_SCHEMAP_REDEFINED_GROUP = 1760
  8465. XML_SCHEMAP_REDEFINED_TYPE = 1761
  8466. XML_SCHEMAP_REDEFINED_ELEMENT = 1762
  8467. XML_SCHEMAP_REDEFINED_ATTRGROUP = 1763
  8468. XML_SCHEMAP_REDEFINED_ATTR = 1764
  8469. XML_SCHEMAP_REDEFINED_NOTATION = 1765
  8470. XML_SCHEMAP_FAILED_PARSE = 1766
  8471. XML_SCHEMAP_UNKNOWN_PREFIX = 1767
  8472. XML_SCHEMAP_DEF_AND_PREFIX = 1768
  8473. XML_SCHEMAP_UNKNOWN_INCLUDE_CHILD = 1769
  8474. XML_SCHEMAP_INCLUDE_SCHEMA_NOT_URI = 1770
  8475. XML_SCHEMAP_INCLUDE_SCHEMA_NO_URI = 1771
  8476. XML_SCHEMAP_NOT_SCHEMA = 1772
  8477. XML_SCHEMAP_UNKNOWN_MEMBER_TYPE = 1773
  8478. XML_SCHEMAP_INVALID_ATTR_USE = 1774
  8479. XML_SCHEMAP_RECURSIVE = 1775
  8480. XML_SCHEMAP_SUPERNUMEROUS_LIST_ITEM_TYPE = 1776
  8481. XML_SCHEMAP_INVALID_ATTR_COMBINATION = 1777
  8482. XML_SCHEMAP_INVALID_ATTR_INLINE_COMBINATION = 1778
  8483. XML_SCHEMAP_MISSING_SIMPLETYPE_CHILD = 1779
  8484. XML_SCHEMAP_INVALID_ATTR_NAME = 1780
  8485. XML_SCHEMAP_REF_AND_CONTENT = 1781
  8486. XML_SCHEMAP_CT_PROPS_CORRECT_1 = 1782
  8487. XML_SCHEMAP_CT_PROPS_CORRECT_2 = 1783
  8488. XML_SCHEMAP_CT_PROPS_CORRECT_3 = 1784
  8489. XML_SCHEMAP_CT_PROPS_CORRECT_4 = 1785
  8490. XML_SCHEMAP_CT_PROPS_CORRECT_5 = 1786
  8491. XML_SCHEMAP_DERIVATION_OK_RESTRICTION_1 = 1787
  8492. XML_SCHEMAP_DERIVATION_OK_RESTRICTION_2_1_1 = 1788
  8493. XML_SCHEMAP_DERIVATION_OK_RESTRICTION_2_1_2 = 1789
  8494. XML_SCHEMAP_DERIVATION_OK_RESTRICTION_2_2 = 1790
  8495. XML_SCHEMAP_DERIVATION_OK_RESTRICTION_3 = 1791
  8496. XML_SCHEMAP_WILDCARD_INVALID_NS_MEMBER = 1792
  8497. XML_SCHEMAP_INTERSECTION_NOT_EXPRESSIBLE = 1793
  8498. XML_SCHEMAP_UNION_NOT_EXPRESSIBLE = 1794
  8499. XML_SCHEMAP_SRC_IMPORT_3_1 = 1795
  8500. XML_SCHEMAP_SRC_IMPORT_3_2 = 1796
  8501. XML_SCHEMAP_DERIVATION_OK_RESTRICTION_4_1 = 1797
  8502. XML_SCHEMAP_DERIVATION_OK_RESTRICTION_4_2 = 1798
  8503. XML_SCHEMAP_DERIVATION_OK_RESTRICTION_4_3 = 1799
  8504. XML_SCHEMAP_COS_CT_EXTENDS_1_3 = 1800
  8505. XML_SCHEMAV_NOROOT = 1801
  8506. XML_SCHEMAV_UNDECLAREDELEM = 1802
  8507. XML_SCHEMAV_NOTTOPLEVEL = 1803
  8508. XML_SCHEMAV_MISSING = 1804
  8509. XML_SCHEMAV_WRONGELEM = 1805
  8510. XML_SCHEMAV_NOTYPE = 1806
  8511. XML_SCHEMAV_NOROLLBACK = 1807
  8512. XML_SCHEMAV_ISABSTRACT = 1808
  8513. XML_SCHEMAV_NOTEMPTY = 1809
  8514. XML_SCHEMAV_ELEMCONT = 1810
  8515. XML_SCHEMAV_HAVEDEFAULT = 1811
  8516. XML_SCHEMAV_NOTNILLABLE = 1812
  8517. XML_SCHEMAV_EXTRACONTENT = 1813
  8518. XML_SCHEMAV_INVALIDATTR = 1814
  8519. XML_SCHEMAV_INVALIDELEM = 1815
  8520. XML_SCHEMAV_NOTDETERMINIST = 1816
  8521. XML_SCHEMAV_CONSTRUCT = 1817
  8522. XML_SCHEMAV_INTERNAL = 1818
  8523. XML_SCHEMAV_NOTSIMPLE = 1819
  8524. XML_SCHEMAV_ATTRUNKNOWN = 1820
  8525. XML_SCHEMAV_ATTRINVALID = 1821
  8526. XML_SCHEMAV_VALUE = 1822
  8527. XML_SCHEMAV_FACET = 1823
  8528. XML_SCHEMAV_CVC_DATATYPE_VALID_1_2_1 = 1824
  8529. XML_SCHEMAV_CVC_DATATYPE_VALID_1_2_2 = 1825
  8530. XML_SCHEMAV_CVC_DATATYPE_VALID_1_2_3 = 1826
  8531. XML_SCHEMAV_CVC_TYPE_3_1_1 = 1827
  8532. XML_SCHEMAV_CVC_TYPE_3_1_2 = 1828
  8533. XML_SCHEMAV_CVC_FACET_VALID = 1829
  8534. XML_SCHEMAV_CVC_LENGTH_VALID = 1830
  8535. XML_SCHEMAV_CVC_MINLENGTH_VALID = 1831
  8536. XML_SCHEMAV_CVC_MAXLENGTH_VALID = 1832
  8537. XML_SCHEMAV_CVC_MININCLUSIVE_VALID = 1833
  8538. XML_SCHEMAV_CVC_MAXINCLUSIVE_VALID = 1834
  8539. XML_SCHEMAV_CVC_MINEXCLUSIVE_VALID = 1835
  8540. XML_SCHEMAV_CVC_MAXEXCLUSIVE_VALID = 1836
  8541. XML_SCHEMAV_CVC_TOTALDIGITS_VALID = 1837
  8542. XML_SCHEMAV_CVC_FRACTIONDIGITS_VALID = 1838
  8543. XML_SCHEMAV_CVC_PATTERN_VALID = 1839
  8544. XML_SCHEMAV_CVC_ENUMERATION_VALID = 1840
  8545. XML_SCHEMAV_CVC_COMPLEX_TYPE_2_1 = 1841
  8546. XML_SCHEMAV_CVC_COMPLEX_TYPE_2_2 = 1842
  8547. XML_SCHEMAV_CVC_COMPLEX_TYPE_2_3 = 1843
  8548. XML_SCHEMAV_CVC_COMPLEX_TYPE_2_4 = 1844
  8549. XML_SCHEMAV_CVC_ELT_1 = 1845
  8550. XML_SCHEMAV_CVC_ELT_2 = 1846
  8551. XML_SCHEMAV_CVC_ELT_3_1 = 1847
  8552. XML_SCHEMAV_CVC_ELT_3_2_1 = 1848
  8553. XML_SCHEMAV_CVC_ELT_3_2_2 = 1849
  8554. XML_SCHEMAV_CVC_ELT_4_1 = 1850
  8555. XML_SCHEMAV_CVC_ELT_4_2 = 1851
  8556. XML_SCHEMAV_CVC_ELT_4_3 = 1852
  8557. XML_SCHEMAV_CVC_ELT_5_1_1 = 1853
  8558. XML_SCHEMAV_CVC_ELT_5_1_2 = 1854
  8559. XML_SCHEMAV_CVC_ELT_5_2_1 = 1855
  8560. XML_SCHEMAV_CVC_ELT_5_2_2_1 = 1856
  8561. XML_SCHEMAV_CVC_ELT_5_2_2_2_1 = 1857
  8562. XML_SCHEMAV_CVC_ELT_5_2_2_2_2 = 1858
  8563. XML_SCHEMAV_CVC_ELT_6 = 1859
  8564. XML_SCHEMAV_CVC_ELT_7 = 1860
  8565. XML_SCHEMAV_CVC_ATTRIBUTE_1 = 1861
  8566. XML_SCHEMAV_CVC_ATTRIBUTE_2 = 1862
  8567. XML_SCHEMAV_CVC_ATTRIBUTE_3 = 1863
  8568. XML_SCHEMAV_CVC_ATTRIBUTE_4 = 1864
  8569. XML_SCHEMAV_CVC_COMPLEX_TYPE_3_1 = 1865
  8570. XML_SCHEMAV_CVC_COMPLEX_TYPE_3_2_1 = 1866
  8571. XML_SCHEMAV_CVC_COMPLEX_TYPE_3_2_2 = 1867
  8572. XML_SCHEMAV_CVC_COMPLEX_TYPE_4 = 1868
  8573. XML_SCHEMAV_CVC_COMPLEX_TYPE_5_1 = 1869
  8574. XML_SCHEMAV_CVC_COMPLEX_TYPE_5_2 = 1870
  8575. XML_SCHEMAV_ELEMENT_CONTENT = 1871
  8576. XML_SCHEMAV_DOCUMENT_ELEMENT_MISSING = 1872
  8577. XML_SCHEMAV_CVC_COMPLEX_TYPE_1 = 1873
  8578. XML_SCHEMAV_CVC_AU = 1874
  8579. XML_SCHEMAV_CVC_TYPE_1 = 1875
  8580. XML_SCHEMAV_CVC_TYPE_2 = 1876
  8581. XML_SCHEMAV_CVC_IDC = 1877
  8582. XML_SCHEMAV_CVC_WILDCARD = 1878
  8583. XML_SCHEMAV_MISC = 1879
  8584. XML_XPTR_UNKNOWN_SCHEME = 1900
  8585. XML_XPTR_CHILDSEQ_START = 1901
  8586. XML_XPTR_EVAL_FAILED = 1902
  8587. XML_XPTR_EXTRA_OBJECTS = 1903
  8588. XML_C14N_CREATE_CTXT = 1950
  8589. XML_C14N_REQUIRES_UTF8 = 1951
  8590. XML_C14N_CREATE_STACK = 1952
  8591. XML_C14N_INVALID_NODE = 1953
  8592. XML_C14N_UNKNOW_NODE = 1954
  8593. XML_C14N_RELATIVE_NAMESPACE = 1955
  8594. XML_FTP_PASV_ANSWER = 2000
  8595. XML_FTP_EPSV_ANSWER = 2001
  8596. XML_FTP_ACCNT = 2002
  8597. XML_FTP_URL_SYNTAX = 2003
  8598. XML_HTTP_URL_SYNTAX = 2020
  8599. XML_HTTP_USE_IP = 2021
  8600. XML_HTTP_UNKNOWN_HOST = 2022
  8601. XML_SCHEMAP_SRC_SIMPLE_TYPE_1 = 3000
  8602. XML_SCHEMAP_SRC_SIMPLE_TYPE_2 = 3001
  8603. XML_SCHEMAP_SRC_SIMPLE_TYPE_3 = 3002
  8604. XML_SCHEMAP_SRC_SIMPLE_TYPE_4 = 3003
  8605. XML_SCHEMAP_SRC_RESOLVE = 3004
  8606. XML_SCHEMAP_SRC_RESTRICTION_BASE_OR_SIMPLETYPE = 3005
  8607. XML_SCHEMAP_SRC_LIST_ITEMTYPE_OR_SIMPLETYPE = 3006
  8608. XML_SCHEMAP_SRC_UNION_MEMBERTYPES_OR_SIMPLETYPES = 3007
  8609. XML_SCHEMAP_ST_PROPS_CORRECT_1 = 3008
  8610. XML_SCHEMAP_ST_PROPS_CORRECT_2 = 3009
  8611. XML_SCHEMAP_ST_PROPS_CORRECT_3 = 3010
  8612. XML_SCHEMAP_COS_ST_RESTRICTS_1_1 = 3011
  8613. XML_SCHEMAP_COS_ST_RESTRICTS_1_2 = 3012
  8614. XML_SCHEMAP_COS_ST_RESTRICTS_1_3_1 = 3013
  8615. XML_SCHEMAP_COS_ST_RESTRICTS_1_3_2 = 3014
  8616. XML_SCHEMAP_COS_ST_RESTRICTS_2_1 = 3015
  8617. XML_SCHEMAP_COS_ST_RESTRICTS_2_3_1_1 = 3016
  8618. XML_SCHEMAP_COS_ST_RESTRICTS_2_3_1_2 = 3017
  8619. XML_SCHEMAP_COS_ST_RESTRICTS_2_3_2_1 = 3018
  8620. XML_SCHEMAP_COS_ST_RESTRICTS_2_3_2_2 = 3019
  8621. XML_SCHEMAP_COS_ST_RESTRICTS_2_3_2_3 = 3020
  8622. XML_SCHEMAP_COS_ST_RESTRICTS_2_3_2_4 = 3021
  8623. XML_SCHEMAP_COS_ST_RESTRICTS_2_3_2_5 = 3022
  8624. XML_SCHEMAP_COS_ST_RESTRICTS_3_1 = 3023
  8625. XML_SCHEMAP_COS_ST_RESTRICTS_3_3_1 = 3024
  8626. XML_SCHEMAP_COS_ST_RESTRICTS_3_3_1_2 = 3025
  8627. XML_SCHEMAP_COS_ST_RESTRICTS_3_3_2_2 = 3026
  8628. XML_SCHEMAP_COS_ST_RESTRICTS_3_3_2_1 = 3027
  8629. XML_SCHEMAP_COS_ST_RESTRICTS_3_3_2_3 = 3028
  8630. XML_SCHEMAP_COS_ST_RESTRICTS_3_3_2_4 = 3029
  8631. XML_SCHEMAP_COS_ST_RESTRICTS_3_3_2_5 = 3030
  8632. XML_SCHEMAP_COS_ST_DERIVED_OK_2_1 = 3031
  8633. XML_SCHEMAP_COS_ST_DERIVED_OK_2_2 = 3032
  8634. XML_SCHEMAP_S4S_ELEM_NOT_ALLOWED = 3033
  8635. XML_SCHEMAP_S4S_ELEM_MISSING = 3034
  8636. XML_SCHEMAP_S4S_ATTR_NOT_ALLOWED = 3035
  8637. XML_SCHEMAP_S4S_ATTR_MISSING = 3036
  8638. XML_SCHEMAP_S4S_ATTR_INVALID_VALUE = 3037
  8639. XML_SCHEMAP_SRC_ELEMENT_1 = 3038
  8640. XML_SCHEMAP_SRC_ELEMENT_2_1 = 3039
  8641. XML_SCHEMAP_SRC_ELEMENT_2_2 = 3040
  8642. XML_SCHEMAP_SRC_ELEMENT_3 = 3041
  8643. XML_SCHEMAP_P_PROPS_CORRECT_1 = 3042
  8644. XML_SCHEMAP_P_PROPS_CORRECT_2_1 = 3043
  8645. XML_SCHEMAP_P_PROPS_CORRECT_2_2 = 3044
  8646. XML_SCHEMAP_E_PROPS_CORRECT_2 = 3045
  8647. XML_SCHEMAP_E_PROPS_CORRECT_3 = 3046
  8648. XML_SCHEMAP_E_PROPS_CORRECT_4 = 3047
  8649. XML_SCHEMAP_E_PROPS_CORRECT_5 = 3048
  8650. XML_SCHEMAP_E_PROPS_CORRECT_6 = 3049
  8651. XML_SCHEMAP_SRC_INCLUDE = 3050
  8652. XML_SCHEMAP_SRC_ATTRIBUTE_1 = 3051
  8653. XML_SCHEMAP_SRC_ATTRIBUTE_2 = 3052
  8654. XML_SCHEMAP_SRC_ATTRIBUTE_3_1 = 3053
  8655. XML_SCHEMAP_SRC_ATTRIBUTE_3_2 = 3054
  8656. XML_SCHEMAP_SRC_ATTRIBUTE_4 = 3055
  8657. XML_SCHEMAP_NO_XMLNS = 3056
  8658. XML_SCHEMAP_NO_XSI = 3057
  8659. XML_SCHEMAP_COS_VALID_DEFAULT_1 = 3058
  8660. XML_SCHEMAP_COS_VALID_DEFAULT_2_1 = 3059
  8661. XML_SCHEMAP_COS_VALID_DEFAULT_2_2_1 = 3060
  8662. XML_SCHEMAP_COS_VALID_DEFAULT_2_2_2 = 3061
  8663. XML_SCHEMAP_CVC_SIMPLE_TYPE = 3062
  8664. XML_SCHEMAP_COS_CT_EXTENDS_1_1 = 3063
  8665. XML_SCHEMAP_SRC_IMPORT_1_1 = 3064
  8666. XML_SCHEMAP_SRC_IMPORT_1_2 = 3065
  8667. XML_SCHEMAP_SRC_IMPORT_2 = 3066
  8668. XML_SCHEMAP_SRC_IMPORT_2_1 = 3067
  8669. XML_SCHEMAP_SRC_IMPORT_2_2 = 3068
  8670. XML_SCHEMAP_INTERNAL = 3069
  8671. XML_SCHEMAP_NOT_DETERMINISTIC = 3070
  8672. XML_SCHEMAP_SRC_ATTRIBUTE_GROUP_1 = 3071
  8673. XML_SCHEMAP_SRC_ATTRIBUTE_GROUP_2 = 3072
  8674. XML_SCHEMAP_SRC_ATTRIBUTE_GROUP_3 = 3073
  8675. XML_SCHEMAP_MG_PROPS_CORRECT_1 = 3074
  8676. XML_SCHEMAP_MG_PROPS_CORRECT_2 = 3075
  8677. XML_SCHEMAP_SRC_CT_1 = 3076
  8678. XML_SCHEMAP_DERIVATION_OK_RESTRICTION_2_1_3 = 3077
  8679. XML_SCHEMAP_AU_PROPS_CORRECT_2 = 3078
  8680. XML_SCHEMAP_A_PROPS_CORRECT_2 = 3079
  8681. XML_SCHEMAP_C_PROPS_CORRECT = 3080
  8682. XML_SCHEMAP_SRC_REDEFINE = 3081
  8683. XML_SCHEMAP_SRC_IMPORT = 3082
  8684. XML_SCHEMAP_WARN_SKIP_SCHEMA = 3083
  8685. XML_SCHEMAP_WARN_UNLOCATED_SCHEMA = 3084
  8686. XML_SCHEMAP_WARN_ATTR_REDECL_PROH = 3085
  8687. XML_SCHEMAP_WARN_ATTR_POINTLESS_PROH = 3086
  8688. XML_SCHEMAP_AG_PROPS_CORRECT = 3087
  8689. XML_SCHEMAP_COS_CT_EXTENDS_1_2 = 3088
  8690. XML_SCHEMAP_AU_PROPS_CORRECT = 3089
  8691. XML_SCHEMAP_A_PROPS_CORRECT_3 = 3090
  8692. XML_SCHEMAP_COS_ALL_LIMITED = 3091
  8693. XML_SCHEMATRONV_ASSERT = 4000
  8694. XML_SCHEMATRONV_REPORT = 4001
  8695. XML_MODULE_OPEN = 4900
  8696. XML_MODULE_CLOSE = 4901
  8697. XML_CHECK_FOUND_ELEMENT = 5000
  8698. XML_CHECK_FOUND_ATTRIBUTE = 5001
  8699. XML_CHECK_FOUND_TEXT = 5002
  8700. XML_CHECK_FOUND_CDATA = 5003
  8701. XML_CHECK_FOUND_ENTITYREF = 5004
  8702. XML_CHECK_FOUND_ENTITY = 5005
  8703. XML_CHECK_FOUND_PI = 5006
  8704. XML_CHECK_FOUND_COMMENT = 5007
  8705. XML_CHECK_FOUND_DOCTYPE = 5008
  8706. XML_CHECK_FOUND_FRAGMENT = 5009
  8707. XML_CHECK_FOUND_NOTATION = 5010
  8708. XML_CHECK_UNKNOWN_NODE = 5011
  8709. XML_CHECK_ENTITY_TYPE = 5012
  8710. XML_CHECK_NO_PARENT = 5013
  8711. XML_CHECK_NO_DOC = 5014
  8712. XML_CHECK_NO_NAME = 5015
  8713. XML_CHECK_NO_ELEM = 5016
  8714. XML_CHECK_WRONG_DOC = 5017
  8715. XML_CHECK_NO_PREV = 5018
  8716. XML_CHECK_WRONG_PREV = 5019
  8717. XML_CHECK_NO_NEXT = 5020
  8718. XML_CHECK_WRONG_NEXT = 5021
  8719. XML_CHECK_NOT_DTD = 5022
  8720. XML_CHECK_NOT_ATTR = 5023
  8721. XML_CHECK_NOT_ATTR_DECL = 5024
  8722. XML_CHECK_NOT_ELEM_DECL = 5025
  8723. XML_CHECK_NOT_ENTITY_DECL = 5026
  8724. XML_CHECK_NOT_NS_DECL = 5027
  8725. XML_CHECK_NO_HREF = 5028
  8726. XML_CHECK_WRONG_PARENT = 5029
  8727. XML_CHECK_NS_SCOPE = 5030
  8728. XML_CHECK_NS_ANCESTOR = 5031
  8729. XML_CHECK_NOT_UTF8 = 5032
  8730. XML_CHECK_NO_DICT = 5033
  8731. XML_CHECK_NOT_NCNAME = 5034
  8732. XML_CHECK_OUTSIDE_DICT = 5035
  8733. XML_CHECK_WRONG_NAME = 5036
  8734. XML_CHECK_NAME_NOT_NULL = 5037
  8735. XML_I18N_NO_NAME = 6000
  8736. XML_I18N_NO_HANDLER = 6001
  8737. XML_I18N_EXCESS_HANDLER = 6002
  8738. XML_I18N_CONV_FAILED = 6003
  8739. XML_I18N_NO_OUTPUT = 6004
  8740. XML_CHECK_ = 6005
  8741. XML_CHECK_X = 6006
  8742.  
  8743. # xmlExpNodeType
  8744. XML_EXP_EMPTY = 0
  8745. XML_EXP_FORBID = 1
  8746. XML_EXP_ATOM = 2
  8747. XML_EXP_SEQ = 3
  8748. XML_EXP_OR = 4
  8749. XML_EXP_COUNT = 5
  8750.  
  8751. # xmlElementContentType
  8752. XML_ELEMENT_CONTENT_PCDATA = 1
  8753. XML_ELEMENT_CONTENT_ELEMENT = 2
  8754. XML_ELEMENT_CONTENT_SEQ = 3
  8755. XML_ELEMENT_CONTENT_OR = 4
  8756.  
  8757. # xmlParserProperties
  8758. XML_PARSER_LOADDTD = 1
  8759. XML_PARSER_DEFAULTATTRS = 2
  8760. XML_PARSER_VALIDATE = 3
  8761. XML_PARSER_SUBST_ENTITIES = 4
  8762.  
  8763. # xmlReaderTypes
  8764. XML_READER_TYPE_NONE = 0
  8765. XML_READER_TYPE_ELEMENT = 1
  8766. XML_READER_TYPE_ATTRIBUTE = 2
  8767. XML_READER_TYPE_TEXT = 3
  8768. XML_READER_TYPE_CDATA = 4
  8769. XML_READER_TYPE_ENTITY_REFERENCE = 5
  8770. XML_READER_TYPE_ENTITY = 6
  8771. XML_READER_TYPE_PROCESSING_INSTRUCTION = 7
  8772. XML_READER_TYPE_COMMENT = 8
  8773. XML_READER_TYPE_DOCUMENT = 9
  8774. XML_READER_TYPE_DOCUMENT_TYPE = 10
  8775. XML_READER_TYPE_DOCUMENT_FRAGMENT = 11
  8776. XML_READER_TYPE_NOTATION = 12
  8777. XML_READER_TYPE_WHITESPACE = 13
  8778. XML_READER_TYPE_SIGNIFICANT_WHITESPACE = 14
  8779. XML_READER_TYPE_END_ELEMENT = 15
  8780. XML_READER_TYPE_END_ENTITY = 16
  8781. XML_READER_TYPE_XML_DECLARATION = 17
  8782.  
  8783. # xmlCatalogPrefer
  8784. XML_CATA_PREFER_NONE = 0
  8785. XML_CATA_PREFER_PUBLIC = 1
  8786. XML_CATA_PREFER_SYSTEM = 2
  8787.  
  8788. # xmlElementType
  8789. XML_ELEMENT_NODE = 1
  8790. XML_ATTRIBUTE_NODE = 2
  8791. XML_TEXT_NODE = 3
  8792. XML_CDATA_SECTION_NODE = 4
  8793. XML_ENTITY_REF_NODE = 5
  8794. XML_ENTITY_NODE = 6
  8795. XML_PI_NODE = 7
  8796. XML_COMMENT_NODE = 8
  8797. XML_DOCUMENT_NODE = 9
  8798. XML_DOCUMENT_TYPE_NODE = 10
  8799. XML_DOCUMENT_FRAG_NODE = 11
  8800. XML_NOTATION_NODE = 12
  8801. XML_HTML_DOCUMENT_NODE = 13
  8802. XML_DTD_NODE = 14
  8803. XML_ELEMENT_DECL = 15
  8804. XML_ATTRIBUTE_DECL = 16
  8805. XML_ENTITY_DECL = 17
  8806. XML_NAMESPACE_DECL = 18
  8807. XML_XINCLUDE_START = 19
  8808. XML_XINCLUDE_END = 20
  8809. XML_DOCB_DOCUMENT_NODE = 21
  8810.  
  8811. # xlinkActuate
  8812. XLINK_ACTUATE_NONE = 0
  8813. XLINK_ACTUATE_AUTO = 1
  8814. XLINK_ACTUATE_ONREQUEST = 2
  8815.  
  8816. # xmlFeature
  8817. XML_WITH_THREAD = 1
  8818. XML_WITH_TREE = 2
  8819. XML_WITH_OUTPUT = 3
  8820. XML_WITH_PUSH = 4
  8821. XML_WITH_READER = 5
  8822. XML_WITH_PATTERN = 6
  8823. XML_WITH_WRITER = 7
  8824. XML_WITH_SAX1 = 8
  8825. XML_WITH_FTP = 9
  8826. XML_WITH_HTTP = 10
  8827. XML_WITH_VALID = 11
  8828. XML_WITH_HTML = 12
  8829. XML_WITH_LEGACY = 13
  8830. XML_WITH_C14N = 14
  8831. XML_WITH_CATALOG = 15
  8832. XML_WITH_XPATH = 16
  8833. XML_WITH_XPTR = 17
  8834. XML_WITH_XINCLUDE = 18
  8835. XML_WITH_ICONV = 19
  8836. XML_WITH_ISO8859X = 20
  8837. XML_WITH_UNICODE = 21
  8838. XML_WITH_REGEXP = 22
  8839. XML_WITH_AUTOMATA = 23
  8840. XML_WITH_EXPR = 24
  8841. XML_WITH_SCHEMAS = 25
  8842. XML_WITH_SCHEMATRON = 26
  8843. XML_WITH_MODULES = 27
  8844. XML_WITH_DEBUG = 28
  8845. XML_WITH_DEBUG_MEM = 29
  8846. XML_WITH_DEBUG_RUN = 30
  8847. XML_WITH_ZLIB = 31
  8848. XML_WITH_ICU = 32
  8849. XML_WITH_NONE = 99999
  8850.  
  8851. # xmlElementContentOccur
  8852. XML_ELEMENT_CONTENT_ONCE = 1
  8853. XML_ELEMENT_CONTENT_OPT = 2
  8854. XML_ELEMENT_CONTENT_MULT = 3
  8855. XML_ELEMENT_CONTENT_PLUS = 4
  8856.  
  8857. # xmlXPathError
  8858. XPATH_EXPRESSION_OK = 0
  8859. XPATH_NUMBER_ERROR = 1
  8860. XPATH_UNFINISHED_LITERAL_ERROR = 2
  8861. XPATH_START_LITERAL_ERROR = 3
  8862. XPATH_VARIABLE_REF_ERROR = 4
  8863. XPATH_UNDEF_VARIABLE_ERROR = 5
  8864. XPATH_INVALID_PREDICATE_ERROR = 6
  8865. XPATH_EXPR_ERROR = 7
  8866. XPATH_UNCLOSED_ERROR = 8
  8867. XPATH_UNKNOWN_FUNC_ERROR = 9
  8868. XPATH_INVALID_OPERAND = 10
  8869. XPATH_INVALID_TYPE = 11
  8870. XPATH_INVALID_ARITY = 12
  8871. XPATH_INVALID_CTXT_SIZE = 13
  8872. XPATH_INVALID_CTXT_POSITION = 14
  8873. XPATH_MEMORY_ERROR = 15
  8874. XPTR_SYNTAX_ERROR = 16
  8875. XPTR_RESOURCE_ERROR = 17
  8876. XPTR_SUB_RESOURCE_ERROR = 18
  8877. XPATH_UNDEF_PREFIX_ERROR = 19
  8878. XPATH_ENCODING_ERROR = 20
  8879. XPATH_INVALID_CHAR_ERROR = 21
  8880. XPATH_INVALID_CTXT = 22
  8881.  
  8882. # xmlTextReaderMode
  8883. XML_TEXTREADER_MODE_INITIAL = 0
  8884. XML_TEXTREADER_MODE_INTERACTIVE = 1
  8885. XML_TEXTREADER_MODE_ERROR = 2
  8886. XML_TEXTREADER_MODE_EOF = 3
  8887. XML_TEXTREADER_MODE_CLOSED = 4
  8888. XML_TEXTREADER_MODE_READING = 5
  8889.  
  8890. # xmlErrorLevel
  8891. XML_ERR_NONE = 0
  8892. XML_ERR_WARNING = 1
  8893. XML_ERR_ERROR = 2
  8894. XML_ERR_FATAL = 3
  8895.  
  8896. # xmlCharEncoding
  8897. XML_CHAR_ENCODING_ERROR = -1
  8898. XML_CHAR_ENCODING_NONE = 0
  8899. XML_CHAR_ENCODING_UTF8 = 1
  8900. XML_CHAR_ENCODING_UTF16LE = 2
  8901. XML_CHAR_ENCODING_UTF16BE = 3
  8902. XML_CHAR_ENCODING_UCS4LE = 4
  8903. XML_CHAR_ENCODING_UCS4BE = 5
  8904. XML_CHAR_ENCODING_EBCDIC = 6
  8905. XML_CHAR_ENCODING_UCS4_2143 = 7
  8906. XML_CHAR_ENCODING_UCS4_3412 = 8
  8907. XML_CHAR_ENCODING_UCS2 = 9
  8908. XML_CHAR_ENCODING_8859_1 = 10
  8909. XML_CHAR_ENCODING_8859_2 = 11
  8910. XML_CHAR_ENCODING_8859_3 = 12
  8911. XML_CHAR_ENCODING_8859_4 = 13
  8912. XML_CHAR_ENCODING_8859_5 = 14
  8913. XML_CHAR_ENCODING_8859_6 = 15
  8914. XML_CHAR_ENCODING_8859_7 = 16
  8915. XML_CHAR_ENCODING_8859_8 = 17
  8916. XML_CHAR_ENCODING_8859_9 = 18
  8917. XML_CHAR_ENCODING_2022_JP = 19
  8918. XML_CHAR_ENCODING_SHIFT_JIS = 20
  8919. XML_CHAR_ENCODING_EUC_JP = 21
  8920. XML_CHAR_ENCODING_ASCII = 22
  8921.  
  8922. # xmlErrorDomain
  8923. XML_FROM_NONE = 0
  8924. XML_FROM_PARSER = 1
  8925. XML_FROM_TREE = 2
  8926. XML_FROM_NAMESPACE = 3
  8927. XML_FROM_DTD = 4
  8928. XML_FROM_HTML = 5
  8929. XML_FROM_MEMORY = 6
  8930. XML_FROM_OUTPUT = 7
  8931. XML_FROM_IO = 8
  8932. XML_FROM_FTP = 9
  8933. XML_FROM_HTTP = 10
  8934. XML_FROM_XINCLUDE = 11
  8935. XML_FROM_XPATH = 12
  8936. XML_FROM_XPOINTER = 13
  8937. XML_FROM_REGEXP = 14
  8938. XML_FROM_DATATYPE = 15
  8939. XML_FROM_SCHEMASP = 16
  8940. XML_FROM_SCHEMASV = 17
  8941. XML_FROM_RELAXNGP = 18
  8942. XML_FROM_RELAXNGV = 19
  8943. XML_FROM_CATALOG = 20
  8944. XML_FROM_C14N = 21
  8945. XML_FROM_XSLT = 22
  8946. XML_FROM_VALID = 23
  8947. XML_FROM_CHECK = 24
  8948. XML_FROM_WRITER = 25
  8949. XML_FROM_MODULE = 26
  8950. XML_FROM_I18N = 27
  8951. XML_FROM_SCHEMATRONV = 28
  8952.  
  8953. # htmlStatus
  8954. HTML_NA = 0
  8955. HTML_INVALID = 1
  8956. HTML_DEPRECATED = 2
  8957. HTML_VALID = 4
  8958. HTML_REQUIRED = 12
  8959.  
  8960. # xmlSchemaValidOption
  8961. XML_SCHEMA_VAL_VC_I_CREATE = 1
  8962.  
  8963. # xmlSchemaWhitespaceValueType
  8964. XML_SCHEMA_WHITESPACE_UNKNOWN = 0
  8965. XML_SCHEMA_WHITESPACE_PRESERVE = 1
  8966. XML_SCHEMA_WHITESPACE_REPLACE = 2
  8967. XML_SCHEMA_WHITESPACE_COLLAPSE = 3
  8968.  
  8969. # htmlParserOption
  8970. HTML_PARSE_RECOVER = 1
  8971. HTML_PARSE_NODEFDTD = 4
  8972. HTML_PARSE_NOERROR = 32
  8973. HTML_PARSE_NOWARNING = 64
  8974. HTML_PARSE_PEDANTIC = 128
  8975. HTML_PARSE_NOBLANKS = 256
  8976. HTML_PARSE_NONET = 2048
  8977. HTML_PARSE_NOIMPLIED = 8192
  8978. HTML_PARSE_COMPACT = 65536
  8979.  
  8980. # xmlRelaxNGValidErr
  8981. XML_RELAXNG_OK = 0
  8982. XML_RELAXNG_ERR_MEMORY = 1
  8983. XML_RELAXNG_ERR_TYPE = 2
  8984. XML_RELAXNG_ERR_TYPEVAL = 3
  8985. XML_RELAXNG_ERR_DUPID = 4
  8986. XML_RELAXNG_ERR_TYPECMP = 5
  8987. XML_RELAXNG_ERR_NOSTATE = 6
  8988. XML_RELAXNG_ERR_NODEFINE = 7
  8989. XML_RELAXNG_ERR_LISTEXTRA = 8
  8990. XML_RELAXNG_ERR_LISTEMPTY = 9
  8991. XML_RELAXNG_ERR_INTERNODATA = 10
  8992. XML_RELAXNG_ERR_INTERSEQ = 11
  8993. XML_RELAXNG_ERR_INTEREXTRA = 12
  8994. XML_RELAXNG_ERR_ELEMNAME = 13
  8995. XML_RELAXNG_ERR_ATTRNAME = 14
  8996. XML_RELAXNG_ERR_ELEMNONS = 15
  8997. XML_RELAXNG_ERR_ATTRNONS = 16
  8998. XML_RELAXNG_ERR_ELEMWRONGNS = 17
  8999. XML_RELAXNG_ERR_ATTRWRONGNS = 18
  9000. XML_RELAXNG_ERR_ELEMEXTRANS = 19
  9001. XML_RELAXNG_ERR_ATTREXTRANS = 20
  9002. XML_RELAXNG_ERR_ELEMNOTEMPTY = 21
  9003. XML_RELAXNG_ERR_NOELEM = 22
  9004. XML_RELAXNG_ERR_NOTELEM = 23
  9005. XML_RELAXNG_ERR_ATTRVALID = 24
  9006. XML_RELAXNG_ERR_CONTENTVALID = 25
  9007. XML_RELAXNG_ERR_EXTRACONTENT = 26
  9008. XML_RELAXNG_ERR_INVALIDATTR = 27
  9009. XML_RELAXNG_ERR_DATAELEM = 28
  9010. XML_RELAXNG_ERR_VALELEM = 29
  9011. XML_RELAXNG_ERR_LISTELEM = 30
  9012. XML_RELAXNG_ERR_DATATYPE = 31
  9013. XML_RELAXNG_ERR_VALUE = 32
  9014. XML_RELAXNG_ERR_LIST = 33
  9015. XML_RELAXNG_ERR_NOGRAMMAR = 34
  9016. XML_RELAXNG_ERR_EXTRADATA = 35
  9017. XML_RELAXNG_ERR_LACKDATA = 36
  9018. XML_RELAXNG_ERR_INTERNAL = 37
  9019. XML_RELAXNG_ERR_ELEMWRONG = 38
  9020. XML_RELAXNG_ERR_TEXTWRONG = 39
  9021.  
  9022. # xmlCatalogAllow
  9023. XML_CATA_ALLOW_NONE = 0
  9024. XML_CATA_ALLOW_GLOBAL = 1
  9025. XML_CATA_ALLOW_DOCUMENT = 2
  9026. XML_CATA_ALLOW_ALL = 3
  9027.  
  9028. # xmlAttributeType
  9029. XML_ATTRIBUTE_CDATA = 1
  9030. XML_ATTRIBUTE_ID = 2
  9031. XML_ATTRIBUTE_IDREF = 3
  9032. XML_ATTRIBUTE_IDREFS = 4
  9033. XML_ATTRIBUTE_ENTITY = 5
  9034. XML_ATTRIBUTE_ENTITIES = 6
  9035. XML_ATTRIBUTE_NMTOKEN = 7
  9036. XML_ATTRIBUTE_NMTOKENS = 8
  9037. XML_ATTRIBUTE_ENUMERATION = 9
  9038. XML_ATTRIBUTE_NOTATION = 10
  9039.  
  9040. # xmlSchematronValidOptions
  9041. XML_SCHEMATRON_OUT_QUIET = 1
  9042. XML_SCHEMATRON_OUT_TEXT = 2
  9043. XML_SCHEMATRON_OUT_XML = 4
  9044. XML_SCHEMATRON_OUT_ERROR = 8
  9045. XML_SCHEMATRON_OUT_FILE = 256
  9046. XML_SCHEMATRON_OUT_BUFFER = 512
  9047. XML_SCHEMATRON_OUT_IO = 1024
  9048.  
  9049. # xmlSchemaContentType
  9050. XML_SCHEMA_CONTENT_UNKNOWN = 0
  9051. XML_SCHEMA_CONTENT_EMPTY = 1
  9052. XML_SCHEMA_CONTENT_ELEMENTS = 2
  9053. XML_SCHEMA_CONTENT_MIXED = 3
  9054. XML_SCHEMA_CONTENT_SIMPLE = 4
  9055. XML_SCHEMA_CONTENT_MIXED_OR_ELEMENTS = 5
  9056. XML_SCHEMA_CONTENT_BASIC = 6
  9057. XML_SCHEMA_CONTENT_ANY = 7
  9058.  
  9059. # xmlSchemaTypeType
  9060. XML_SCHEMA_TYPE_BASIC = 1
  9061. XML_SCHEMA_TYPE_ANY = 2
  9062. XML_SCHEMA_TYPE_FACET = 3
  9063. XML_SCHEMA_TYPE_SIMPLE = 4
  9064. XML_SCHEMA_TYPE_COMPLEX = 5
  9065. XML_SCHEMA_TYPE_SEQUENCE = 6
  9066. XML_SCHEMA_TYPE_CHOICE = 7
  9067. XML_SCHEMA_TYPE_ALL = 8
  9068. XML_SCHEMA_TYPE_SIMPLE_CONTENT = 9
  9069. XML_SCHEMA_TYPE_COMPLEX_CONTENT = 10
  9070. XML_SCHEMA_TYPE_UR = 11
  9071. XML_SCHEMA_TYPE_RESTRICTION = 12
  9072. XML_SCHEMA_TYPE_EXTENSION = 13
  9073. XML_SCHEMA_TYPE_ELEMENT = 14
  9074. XML_SCHEMA_TYPE_ATTRIBUTE = 15
  9075. XML_SCHEMA_TYPE_ATTRIBUTEGROUP = 16
  9076. XML_SCHEMA_TYPE_GROUP = 17
  9077. XML_SCHEMA_TYPE_NOTATION = 18
  9078. XML_SCHEMA_TYPE_LIST = 19
  9079. XML_SCHEMA_TYPE_UNION = 20
  9080. XML_SCHEMA_TYPE_ANY_ATTRIBUTE = 21
  9081. XML_SCHEMA_TYPE_IDC_UNIQUE = 22
  9082. XML_SCHEMA_TYPE_IDC_KEY = 23
  9083. XML_SCHEMA_TYPE_IDC_KEYREF = 24
  9084. XML_SCHEMA_TYPE_PARTICLE = 25
  9085. XML_SCHEMA_TYPE_ATTRIBUTE_USE = 26
  9086. XML_SCHEMA_FACET_MININCLUSIVE = 1000
  9087. XML_SCHEMA_FACET_MINEXCLUSIVE = 1001
  9088. XML_SCHEMA_FACET_MAXINCLUSIVE = 1002
  9089. XML_SCHEMA_FACET_MAXEXCLUSIVE = 1003
  9090. XML_SCHEMA_FACET_TOTALDIGITS = 1004
  9091. XML_SCHEMA_FACET_FRACTIONDIGITS = 1005
  9092. XML_SCHEMA_FACET_PATTERN = 1006
  9093. XML_SCHEMA_FACET_ENUMERATION = 1007
  9094. XML_SCHEMA_FACET_WHITESPACE = 1008
  9095. XML_SCHEMA_FACET_LENGTH = 1009
  9096. XML_SCHEMA_FACET_MAXLENGTH = 1010
  9097. XML_SCHEMA_FACET_MINLENGTH = 1011
  9098. XML_SCHEMA_EXTRA_QNAMEREF = 2000
  9099. XML_SCHEMA_EXTRA_ATTR_USE_PROHIB = 2001
  9100.  
  9101. # xmlModuleOption
  9102. XML_MODULE_LAZY = 1
  9103. XML_MODULE_LOCAL = 2
  9104.  
  9105. # xmlParserMode
  9106. XML_PARSE_UNKNOWN = 0
  9107. XML_PARSE_DOM = 1
  9108. XML_PARSE_SAX = 2
  9109. XML_PARSE_PUSH_DOM = 3
  9110. XML_PARSE_PUSH_SAX = 4
  9111. XML_PARSE_READER = 5
  9112.  
  9113. # xmlC14NMode
  9114. XML_C14N_1_0 = 0
  9115. XML_C14N_EXCLUSIVE_1_0 = 1
  9116. XML_C14N_1_1 = 2
  9117.  
  9118. # xmlParserOption
  9119. XML_PARSE_RECOVER = 1
  9120. XML_PARSE_NOENT = 2
  9121. XML_PARSE_DTDLOAD = 4
  9122. XML_PARSE_DTDATTR = 8
  9123. XML_PARSE_DTDVALID = 16
  9124. XML_PARSE_NOERROR = 32
  9125. XML_PARSE_NOWARNING = 64
  9126. XML_PARSE_PEDANTIC = 128
  9127. XML_PARSE_NOBLANKS = 256
  9128. XML_PARSE_SAX1 = 512
  9129. XML_PARSE_XINCLUDE = 1024
  9130. XML_PARSE_NONET = 2048
  9131. XML_PARSE_NODICT = 4096
  9132. XML_PARSE_NSCLEAN = 8192
  9133. XML_PARSE_NOCDATA = 16384
  9134. XML_PARSE_NOXINCNODE = 32768
  9135. XML_PARSE_COMPACT = 65536
  9136. XML_PARSE_OLD10 = 131072
  9137. XML_PARSE_NOBASEFIX = 262144
  9138. XML_PARSE_HUGE = 524288
  9139. XML_PARSE_OLDSAX = 1048576
  9140.  
  9141. # xmlElementTypeVal
  9142. XML_ELEMENT_TYPE_UNDEFINED = 0
  9143. XML_ELEMENT_TYPE_EMPTY = 1
  9144. XML_ELEMENT_TYPE_ANY = 2
  9145. XML_ELEMENT_TYPE_MIXED = 3
  9146. XML_ELEMENT_TYPE_ELEMENT = 4
  9147.  
  9148. # xmlDocProperties
  9149. XML_DOC_WELLFORMED = 1
  9150. XML_DOC_NSVALID = 2
  9151. XML_DOC_OLD10 = 4
  9152. XML_DOC_DTDVALID = 8
  9153. XML_DOC_XINCLUDE = 16
  9154. XML_DOC_USERBUILT = 32
  9155. XML_DOC_INTERNAL = 64
  9156. XML_DOC_HTML = 128
  9157.  
  9158. # xlinkType
  9159. XLINK_TYPE_NONE = 0
  9160. XLINK_TYPE_SIMPLE = 1
  9161. XLINK_TYPE_EXTENDED = 2
  9162. XLINK_TYPE_EXTENDED_SET = 3
  9163.  
  9164. # xmlXPathObjectType
  9165. XPATH_UNDEFINED = 0
  9166. XPATH_NODESET = 1
  9167. XPATH_BOOLEAN = 2
  9168. XPATH_NUMBER = 3
  9169. XPATH_STRING = 4
  9170. XPATH_POINT = 5
  9171. XPATH_RANGE = 6
  9172. XPATH_LOCATIONSET = 7
  9173. XPATH_USERS = 8
  9174. XPATH_XSLT_TREE = 9
  9175.  
  9176. # xmlSchemaValidError
  9177. XML_SCHEMAS_ERR_OK = 0
  9178. XML_SCHEMAS_ERR_NOROOT = 1
  9179. XML_SCHEMAS_ERR_UNDECLAREDELEM = 2
  9180. XML_SCHEMAS_ERR_NOTTOPLEVEL = 3
  9181. XML_SCHEMAS_ERR_MISSING = 4
  9182. XML_SCHEMAS_ERR_WRONGELEM = 5
  9183. XML_SCHEMAS_ERR_NOTYPE = 6
  9184. XML_SCHEMAS_ERR_NOROLLBACK = 7
  9185. XML_SCHEMAS_ERR_ISABSTRACT = 8
  9186. XML_SCHEMAS_ERR_NOTEMPTY = 9
  9187. XML_SCHEMAS_ERR_ELEMCONT = 10
  9188. XML_SCHEMAS_ERR_HAVEDEFAULT = 11
  9189. XML_SCHEMAS_ERR_NOTNILLABLE = 12
  9190. XML_SCHEMAS_ERR_EXTRACONTENT = 13
  9191. XML_SCHEMAS_ERR_INVALIDATTR = 14
  9192. XML_SCHEMAS_ERR_INVALIDELEM = 15
  9193. XML_SCHEMAS_ERR_NOTDETERMINIST = 16
  9194. XML_SCHEMAS_ERR_CONSTRUCT = 17
  9195. XML_SCHEMAS_ERR_INTERNAL = 18
  9196. XML_SCHEMAS_ERR_NOTSIMPLE = 19
  9197. XML_SCHEMAS_ERR_ATTRUNKNOWN = 20
  9198. XML_SCHEMAS_ERR_ATTRINVALID = 21
  9199. XML_SCHEMAS_ERR_VALUE = 22
  9200. XML_SCHEMAS_ERR_FACET = 23
  9201. XML_SCHEMAS_ERR_ = 24
  9202. XML_SCHEMAS_ERR_XXX = 25
  9203.  
  9204.